From de777c38428237764bb2c4a547d32e2ea7cc3668 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 05:20:59 +0900 Subject: [PATCH 01/35] Add VocabularyObject and raw property helpers Applications cannot read JSON-LD properties that Fedify has no typed accessor for without relying on the serialization cache, whose retention of unknown properties depends on contexts and options. This adds the runtime half of a read API for them: - VocabularyObject, an interface every class generated by @fedify/vocab-tools will implement. Its "~fedify.vocab" brand is a string key, so that objects generated against different copies of @fedify/vocab-runtime stay assignable to each other's declarations. - RawPropertyValue and its value, node, and list object shapes for expanded JSON-LD values. - Internal helpers under @fedify/vocab-runtime/internal/raw-property for the functions that the generator will emit: property IRI validation and lookup keys, a warning for non-HTTP(S) schemes with hints for well-known prefixes, retention of unknown properties, normalization of encoded values, cycle detection while encoding nested objects, and a Symbol.for() protocol through which one generated module's functions can read another module's objects. https://github.com/fedify-dev/fedify/issues/1272 Assisted-by: Claude Code:claude-opus-5-5 --- CHANGES.md | 7 + changes.d/vocab-runtime/vocabulary-object.md | 10 + packages/vocab-runtime/deno.json | 1 + packages/vocab-runtime/package.json | 10 + .../src/internal/raw-property.test.ts | 194 +++++++++ .../src/internal/raw-property.ts | 387 ++++++++++++++++++ packages/vocab-runtime/src/mod.ts | 7 + .../vocab-runtime/src/vocabulary-object.ts | 87 ++++ packages/vocab-runtime/tsdown.config.ts | 1 + 9 files changed, 704 insertions(+) create mode 100644 changes.d/vocab-runtime/vocabulary-object.md create mode 100644 packages/vocab-runtime/src/internal/raw-property.test.ts create mode 100644 packages/vocab-runtime/src/internal/raw-property.ts create mode 100644 packages/vocab-runtime/src/vocabulary-object.ts diff --git a/CHANGES.md b/CHANGES.md index 30b7b14fd..cff26ddf1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -355,9 +355,16 @@ To be released. e.g., `zh-YUE` with `yue`. `Intl.Locale` rejects extlang tags, so applications can normalize such tags before passing them to it. [[#1229], [#1231]] + - Added the `VocabularyObject` interface, which every class generated by + `@fedify/vocab-tools` implements, and the `RawPropertyValue` type with its + `RawValueObject`, `RawNodeObject`, and `RawListObject` shapes for the + expanded JSON-LD values that `getRawPropertyValues()` returns. + [[#1272], [#1356]] [#1229]: https://github.com/fedify-dev/fedify/issues/1229 [#1231]: https://github.com/fedify-dev/fedify/pull/1231 +[#1272]: https://github.com/fedify-dev/fedify/issues/1272 +[#1356]: https://github.com/fedify-dev/fedify/pull/1356 ### @fedify/vocab-tools diff --git a/changes.d/vocab-runtime/vocabulary-object.md b/changes.d/vocab-runtime/vocabulary-object.md new file mode 100644 index 000000000..87254be42 --- /dev/null +++ b/changes.d/vocab-runtime/vocabulary-object.md @@ -0,0 +1,10 @@ +--- +links: + '#1272': https://github.com/fedify-dev/fedify/issues/1272 + '#1356': https://github.com/fedify-dev/fedify/pull/1356 +--- + - Added the `VocabularyObject` interface, which every class generated by + `@fedify/vocab-tools` implements, and the `RawPropertyValue` type with its + `RawValueObject`, `RawNodeObject`, and `RawListObject` shapes for the + expanded JSON-LD values that `getRawPropertyValues()` returns. + [[#1272], [#1356]] diff --git a/packages/vocab-runtime/deno.json b/packages/vocab-runtime/deno.json index 4089387b2..ef74b478b 100644 --- a/packages/vocab-runtime/deno.json +++ b/packages/vocab-runtime/deno.json @@ -6,6 +6,7 @@ ".": "./src/mod.ts", "./internal/jsonld-cache": "./src/internal/jsonld-cache.ts", "./internal/portable-dereference": "./src/internal/portable-dereference.ts", + "./internal/raw-property": "./src/internal/raw-property.ts", "./internal/signed-representation": "./src/internal/signed-representation.ts", "./internal": "./src/internal.ts", "./jsonld": "./src/jsonld.ts", diff --git a/packages/vocab-runtime/package.json b/packages/vocab-runtime/package.json index 16a0a7c3c..47d3c5bc4 100644 --- a/packages/vocab-runtime/package.json +++ b/packages/vocab-runtime/package.json @@ -72,6 +72,16 @@ "require": "./dist/internal/portable-dereference.cjs", "default": "./dist/internal/portable-dereference.js" }, + "./internal/raw-property": { + "types": { + "import": "./dist/internal/raw-property.d.ts", + "require": "./dist/internal/raw-property.d.cts", + "default": "./dist/internal/raw-property.d.ts" + }, + "import": "./dist/internal/raw-property.js", + "require": "./dist/internal/raw-property.cjs", + "default": "./dist/internal/raw-property.js" + }, "./internal/signed-representation": { "types": { "import": "./dist/internal/signed-representation.d.ts", diff --git a/packages/vocab-runtime/src/internal/raw-property.test.ts b/packages/vocab-runtime/src/internal/raw-property.test.ts new file mode 100644 index 000000000..65d007831 --- /dev/null +++ b/packages/vocab-runtime/src/internal/raw-property.test.ts @@ -0,0 +1,194 @@ +import { deepStrictEqual, ok, rejects, strictEqual, throws } from "node:assert"; +import { test } from "node:test"; +import { + createRawPropertyEncodingOptions, + encodeNestedVocabularyValue, + expandRawPropertyValue, + parseRawPropertyIri, + RAW_PROPERTY_PROTOCOL, + readRawPropertyValues, + retainRawProperties, +} from "./raw-property.ts"; + +test("parseRawPropertyIri() accepts absolute IRIs", () => { + deepStrictEqual( + parseRawPropertyIri("https://example.com/ns#prop", "f"), + ["https://example.com/ns#prop"], + ); + deepStrictEqual( + parseRawPropertyIri(new URL("https://example.com/ns#prop"), "f"), + ["https://example.com/ns#prop"], + ); + deepStrictEqual( + parseRawPropertyIri("HTTPS://Example.COM/ns#prop", "f"), + ["HTTPS://Example.COM/ns#prop", "https://example.com/ns#prop"], + ); + deepStrictEqual( + parseRawPropertyIri("https://例え.jp/語#性質", "f")[0], + "https://例え.jp/語#性質", + ); + deepStrictEqual(parseRawPropertyIri("https://[::1]/ns#prop", "f"), [ + "https://[::1]/ns#prop", + ]); + deepStrictEqual(parseRawPropertyIri("urn:example:prop", "f"), [ + "urn:example:prop", + ]); +}); + +test("parseRawPropertyIri() rejects what is not an absolute IRI", () => { + for ( + const iri of [ + "", + "@id", + "@vocab", + "_:b0", + "content", + "/content", + "#content", + "../content", + "https:", + "https://example.com/a b", + " https://example.com/", + "https://example.com/\n", + "https://example.com/", + "https://example.com/%", + "https://example.com/%2", + "https://example.com/#a#b", + "https://example.com/[a]", + "https://example.com/\uD800", + ] + ) { + throws(() => parseRawPropertyIri(iri, "f"), TypeError, JSON.stringify(iri)); + } + throws(() => parseRawPropertyIri(null, "f"), TypeError); + throws(() => parseRawPropertyIri(123, "f"), TypeError); +}); + +test("retainRawProperties() keeps only unknown properties", () => { + const node = { + "@id": "https://example.com/", + "@type": ["https://example.com/Type"], + "_:gateways": [{ "@value": "x" }], + "https://example.com/known": [{ "@value": 1 }], + "https://example.com/unknown": [{ "@value": { a: [1] }, "@type": "@json" }], + }; + const retained = retainRawProperties( + node, + new Set(["https://example.com/known"]), + ); + deepStrictEqual(retained, { + "https://example.com/unknown": [{ "@value": { a: [1] }, "@type": "@json" }], + }); + ok(Object.isFrozen(retained)); + ok(Object.isFrozen(retained!["https://example.com/unknown"])); + ok( + Object.isFrozen( + (retained!["https://example.com/unknown"][0] as { "@value": object })[ + "@value" + ], + ), + ); + // The retained values are independent of the input node: + node["https://example.com/unknown"][0]["@value"].a.push(2); + deepStrictEqual(retained!["https://example.com/unknown"], [ + { "@value": { a: [1] }, "@type": "@json" }, + ]); + strictEqual( + retainRawProperties( + { "https://example.com/known": [] }, + new Set(["https://example.com/known"]), + ), + undefined, + ); +}); + +test("expandRawPropertyValue() normalizes encoded values", async () => { + deepStrictEqual( + await expandRawPropertyValue("https://example.com/p", [ + { "@value": "a" }, + { "@id": "https://example.com/" }, + ]), + [{ "@value": "a" }, { "@id": "https://example.com/" }], + ); + deepStrictEqual( + await expandRawPropertyValue("https://example.com/p", { + "@list": [{ "@value": 1 }], + }), + [{ "@list": [{ "@value": 1 }] }], + ); +}); + +test("encodeNestedVocabularyValue() rejects cycles, not shared objects", async () => { + const a = {}; + const b = {}; + const stack = new Set([a]); + const options = createRawPropertyEncodingOptions(stack); + // Shared object, visited twice in sequence: + strictEqual( + await encodeNestedVocabularyValue(options, b, () => Promise.resolve(1)), + 1, + ); + strictEqual( + await encodeNestedVocabularyValue(options, b, () => Promise.resolve(2)), + 2, + ); + deepStrictEqual([...stack], [a]); + // Cycle back to an object that is being encoded: + await rejects( + () => + encodeNestedVocabularyValue( + options, + b, + () => encodeNestedVocabularyValue(options, a, () => Promise.resolve(3)), + ), + TypeError, + ); + deepStrictEqual([...stack], [a]); + // Without the raw property options, no tracking takes place: + strictEqual( + await encodeNestedVocabularyValue({}, a, () => Promise.resolve(4)), + 4, + ); + // The tracking survives spreading, as toJsonLd() does with its options: + await rejects( + () => + encodeNestedVocabularyValue( + { ...options, contextLoader: undefined }, + a, + () => Promise.resolve(5), + ), + TypeError, + ); +}); + +test("readRawPropertyValues() dispatches through the protocol", async () => { + const requests: unknown[] = []; + const retained = Object.freeze([Object.freeze({ "@value": "x" })]); + const object = { + [RAW_PROPERTY_PROTOCOL](request: unknown) { + requests.push(request); + return Promise.resolve(retained); + }, + }; + const values = await readRawPropertyValues( + object, + "HTTPS://example.com/p", + "f", + ); + deepStrictEqual(values, [{ "@value": "x" }]); + ok(!Object.isFrozen(values[0])); + strictEqual(requests.length, 1); + deepStrictEqual( + (requests[0] as { candidates: string[] }).candidates, + ["HTTPS://example.com/p", "https://example.com/p"], + ); + ok((requests[0] as { stack: Set }).stack.has(object)); + await rejects( + () => readRawPropertyValues({}, "https://example.com/p", "f"), + TypeError, + ); + await rejects( + () => readRawPropertyValues(null, "https://example.com/p", "f"), + TypeError, + ); +}); diff --git a/packages/vocab-runtime/src/internal/raw-property.ts b/packages/vocab-runtime/src/internal/raw-property.ts new file mode 100644 index 000000000..f1a846533 --- /dev/null +++ b/packages/vocab-runtime/src/internal/raw-property.ts @@ -0,0 +1,387 @@ +import { getLogger } from "@logtape/logtape"; +import type { DocumentLoader } from "../docloader.ts"; +import jsonld from "../jsonld.ts"; +import type { RawPropertyValue } from "../vocabulary-object.ts"; + +/** + * The key of the method through which the raw property functions reach the + * per-class logic of generated vocabulary classes. It is registered with + * `Symbol.for()`, so that the functions generated into one module can read + * objects generated into another, even when the modules depend on different + * copies of this package. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export const RAW_PROPERTY_PROTOCOL: unique symbol = Symbol.for( + "@fedify/vocab-runtime.rawPropertyProtocol.v1", +) as never; + +const RAW_PROPERTY_ENCODING_STACK = Symbol.for( + "@fedify/vocab-runtime.rawPropertyEncodingStack.v1", +); + +/** + * A request passed to the {@link RAW_PROPERTY_PROTOCOL} method. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export interface RawPropertyRequest { + /** + * The property IRIs to look up, in order of preference. The first one + * that is either a known property of the object or a retained unknown + * property is used. + */ + readonly candidates: readonly string[]; + + /** + * The objects that are being encoded, used to detect cycles. + */ + readonly stack: Set; +} + +/** + * The signature of the {@link RAW_PROPERTY_PROTOCOL} method. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export type RawPropertyProtocolMethod = ( + this: object, + request: RawPropertyRequest, +) => Promise; + +/** + * Unknown properties retained while decoding an object, keyed by their full + * property IRIs. The record and its values are deeply frozen. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export type RetainedRawProperties = Readonly< + Record +>; + +function deepFreeze(value: T): T { + if (value == null || typeof value !== "object") return value; + for (const child of Object.values(value)) deepFreeze(child); + return Object.freeze(value); +} + +/** + * Collects the properties of an expanded JSON-LD node that are not known to + * the class decoding it. JSON-LD keywords and blank node identifiers used as + * keys are not properties, so they are never retained. + * + * @param node The expanded JSON-LD node. + * @param knownIris The full IRIs of the properties the class decodes, + * including inherited properties and redundant aliases. + * @returns The deeply frozen unknown properties, or `undefined` if there are + * none. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export function retainRawProperties( + node: Record, + knownIris: ReadonlySet, +): RetainedRawProperties | undefined { + let retained: Record | undefined; + for (const [key, value] of Object.entries(node)) { + if (key.startsWith("@") || key.startsWith("_:") || knownIris.has(key)) { + continue; + } + if (!Array.isArray(value)) continue; + retained ??= {}; + retained[key] = structuredClone(value); + } + return retained == null ? undefined : deepFreeze(retained); +} + +/** + * Normalizes the values of a known property, which a generated encoder + * produced in the same shape as `toJsonLd({ format: "expand" })` does, into + * expanded JSON-LD. + * + * @param iri The full IRI of the property. + * @param value The encoded property value: an array of values, or a list + * object. + * @param contextLoader The loader for remote JSON-LD contexts. The encoded + * value has no context, so it is not expected to be + * used. + * @returns The expanded values of the property. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export async function expandRawPropertyValue( + iri: string, + value: unknown, + contextLoader?: DocumentLoader, +): Promise { + const expanded = await jsonld.expand( + { [iri]: value } as Parameters[0], + { documentLoader: contextLoader, keepFreeFloatingNodes: true }, + ); + const node = expanded[0] as Record | undefined; + const values = node?.[iri]; + return Array.isArray(values) ? values : []; +} + +/** + * Creates the options that a generated per-property encoder passes to the + * `toJsonLd()` method of nested vocabulary objects. + * + * @param stack The objects that are being encoded. + * @param contextLoader The loader for remote JSON-LD contexts. + * @returns The options for `toJsonLd()`. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export function createRawPropertyEncodingOptions( + stack: Set, + contextLoader?: DocumentLoader, +): { format: "expand"; contextLoader?: DocumentLoader } { + return { + format: "expand", + contextLoader, + [RAW_PROPERTY_ENCODING_STACK]: stack, + } as { format: "expand"; contextLoader?: DocumentLoader }; +} + +/** + * Encodes a nested vocabulary object. When the encoding was started by a raw + * property function, it tracks the objects being encoded and throws on a + * cycle. Otherwise, it just calls `encode()`. + * + * @param options The options of the enclosing `toJsonLd()` call. + * @param value The nested object to encode. + * @param encode The function that encodes `value`. + * @returns The result of `encode()`. + * @throws {TypeError} If `value` is already being encoded, i.e., the object + * graph has a cycle. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export async function encodeNestedVocabularyValue( + options: object, + value: object, + encode: () => Promise, +): Promise { + const stack = (options as Record)[ + RAW_PROPERTY_ENCODING_STACK + ] as Set | undefined; + if (stack == null) return await encode(); + if (stack.has(value)) { + throw new TypeError( + "Cannot encode the raw property values of a cyclic object graph.", + ); + } + stack.add(value); + try { + return await encode(); + } finally { + stack.delete(value); + } +} + +const SCHEME_PATTERN = /^([A-Za-z][A-Za-z0-9+.-]*):/; + +// Characters that RFC 3987 does not allow anywhere in an IRI: controls, +// space, and the excluded ASCII characters. +// deno-lint-ignore no-control-regex +const INVALID_CHAR_PATTERN = /[\u0000- "<>\\^`{|}\u007f-\u009f]/; + +const INVALID_PERCENT_PATTERN = /%(?![0-9A-Fa-f]{2})/; + +const LONE_SURROGATE_PATTERN = + /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?> = { + as: "https://www.w3.org/ns/activitystreams#", + dcterms: "http://purl.org/dc/terms/", + fedibird: "http://fedibird.com/ns#", + ldp: "http://www.w3.org/ns/ldp#", + litepub: "http://litepub.social/ns#", + misskey: "https://misskey-hub.net/ns#", + schema: "http://schema.org#", + sec: "https://w3id.org/security#", + toot: "http://joinmastodon.org/ns#", + vcard: "http://www.w3.org/2006/vcard/ns#", +}; + +const MAX_WARNED_IRIS = 1024; +const warnedIris = new Set(); + +function warnUnusualScheme( + iri: string, + scheme: string, + functionName: string, +): void { + if (warnedIris.has(iri)) return; + warnedIris.add(iri); + if (warnedIris.size > MAX_WARNED_IRIS) { + warnedIris.delete(warnedIris.values().next().value!); + } + const logger = getLogger(["fedify", "vocab"]); + const namespace = Object.hasOwn(WELL_KNOWN_PREFIXES, scheme) + ? WELL_KNOWN_PREFIXES[scheme] + : undefined; + if (namespace == null) { + logger.warn( + "The property IRI {iri} passed to {function}() uses the {scheme}: " + + "scheme rather than http: or https:. Note that compact IRIs are " + + "not expanded; pass the full property IRI.", + { iri, scheme, function: functionName }, + ); + } else { + const suggestion = namespace + iri.substring(scheme.length + 1); + logger.warn( + "The property IRI {iri} passed to {function}() looks like a compact " + + "IRI, which is not expanded. Did you mean {suggestion}?", + { iri, scheme, function: functionName, suggestion }, + ); + } +} + +/** + * Validates a property IRI passed to a raw property function and returns the + * keys to look it up by. + * + * @param iri The property IRI. + * @param functionName The name of the public function, used in messages. + * @returns The lookup keys, in order of preference: the IRI as given, then + * its WHATWG URL serialization if that differs. + * @throws {TypeError} If `iri` is not a string or a `URL`, or is not an + * absolute IRI. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export function parseRawPropertyIri( + iri: unknown, + functionName: string, +): string[] { + let exact: string; + if (typeof iri === "string") exact = iri; + else if (iri instanceof URL) exact = iri.href; + else { + throw new TypeError( + `The property IRI passed to ${functionName}() must be a string or a ` + + "URL.", + ); + } + if (exact === "") { + throw new TypeError( + `The property IRI passed to ${functionName}() must not be empty.`, + ); + } + if (exact.startsWith("@")) { + throw new TypeError( + `${functionName}() does not accept JSON-LD keywords such as ` + + `${JSON.stringify(exact)}; pass a full property IRI.`, + ); + } + if (exact.startsWith("_:")) { + throw new TypeError( + `${functionName}() does not accept blank node identifiers such as ` + + `${JSON.stringify(exact)}; pass a full property IRI.`, + ); + } + const match = SCHEME_PATTERN.exec(exact); + if (match == null) { + throw new TypeError( + `The property IRI passed to ${functionName}() must be an absolute ` + + `IRI, but got ${JSON.stringify(exact)}. Terms and relative ` + + "references are not expanded.", + ); + } + if (!isIriSyntax(exact.substring(match[0].length))) { + throw new TypeError( + `The property IRI passed to ${functionName}() is not a valid IRI: ` + + `${JSON.stringify(exact)}.`, + ); + } + const scheme = match[1].toLowerCase(); + if (scheme !== "http" && scheme !== "https") { + warnUnusualScheme(exact, match[1], functionName); + } + const keys = [exact]; + if (typeof iri === "string" && URL.canParse(exact)) { + const normalized = new URL(exact).href; + if (normalized !== exact) keys.push(normalized); + } + return keys; +} + +function isIriSyntax(rest: string): boolean { + if (rest === "") return false; + if ( + INVALID_CHAR_PATTERN.test(rest) || INVALID_PERCENT_PATTERN.test(rest) || + LONE_SURROGATE_PATTERN.test(rest) + ) { + return false; + } + const fragmentIndex = rest.indexOf("#"); + if (fragmentIndex >= 0 && rest.indexOf("#", fragmentIndex + 1) >= 0) { + return false; + } + // Square brackets may only delimit an IP literal in the authority: + let path = rest; + if (rest.startsWith("//")) { + const end = rest.slice(2).search(/[/?#]/); + path = end < 0 ? "" : rest.slice(2 + end); + } + return !path.includes("[") && !path.includes("]"); +} + +/** + * Implements the `getRawPropertyValues()` function generated into every + * vocabulary module. + * + * @param object The vocabulary object to read. + * @param propertyIri The full IRI of the property. + * @param functionName The name of the public function, used in messages. + * @returns Deep copies of the property's values in expanded JSON-LD. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. + */ +export async function readRawPropertyValues( + object: unknown, + propertyIri: unknown, + functionName: string, +): Promise { + const candidates = parseRawPropertyIri(propertyIri, functionName); + const method = object == null || typeof object !== "object" + ? undefined + : (object as Record)[RAW_PROPERTY_PROTOCOL]; + if (typeof method !== "function") { + throw new TypeError( + `${functionName}() expects a vocabulary object generated by ` + + "@fedify/vocab-tools.", + ); + } + const values = await (method as RawPropertyProtocolMethod).call( + object as object, + { candidates, stack: new Set([object as object]) }, + ); + return structuredClone(values) as RawPropertyValue[]; +} diff --git a/packages/vocab-runtime/src/mod.ts b/packages/vocab-runtime/src/mod.ts index 946f28b83..b3df2aa95 100644 --- a/packages/vocab-runtime/src/mod.ts +++ b/packages/vocab-runtime/src/mod.ts @@ -78,6 +78,13 @@ export { type PropertyPreprocessor, type PropertyPreprocessorContext, } from "./preprocessor.ts"; +export type { + RawListObject, + RawNodeObject, + RawPropertyValue, + RawValueObject, + VocabularyObject, +} from "./vocabulary-object.ts"; export { arePortableUrisEqual, canonicalizePortableUri, diff --git a/packages/vocab-runtime/src/vocabulary-object.ts b/packages/vocab-runtime/src/vocabulary-object.ts new file mode 100644 index 000000000..28882560d --- /dev/null +++ b/packages/vocab-runtime/src/vocabulary-object.ts @@ -0,0 +1,87 @@ +import type { DocumentLoader } from "./docloader.ts"; + +/** + * An object of a vocabulary class generated by `@fedify/vocab-tools`, such + * as `Note` or `Person` from `@fedify/vocab`. + * + * Every root class that `@fedify/vocab-tools` generates implements this + * interface, so it covers the classes of third-party vocabulary modules + * generated with the same tool as well. Only generated classes are meant to + * implement it: the `"~fedify.vocab"` brand keeps arbitrary objects with a + * `toJsonLd()` method from satisfying it by accident. + * + * @since 2.5.0 + */ +export interface VocabularyObject { + /** + * The brand that marks generated vocabulary objects. It is always `true`. + * Its name is a string rather than a symbol, so that objects generated + * against different copies of `@fedify/vocab-runtime` stay compatible with + * each other's type declarations. + */ + readonly "~fedify.vocab": true; + + /** + * The object's `@id`, or `null` if it has none. + */ + readonly id: URL | null; + + /** + * Converts this object to a JSON-LD structure. + * @param options The options to use. + * @returns The JSON-LD representation of this object. + */ + toJsonLd(options?: { + format?: "compact" | "expand"; + contextLoader?: DocumentLoader; + context?: + | string + | Record + | (string | Record)[]; + }): Promise; +} + +/** + * A value object in expanded JSON-LD, such as + * `{ "@value": "Hello", "@language": "en" }`. A JSON literal has + * `"@type": "@json"`, and its `@value` is the JSON value itself. + * @since 2.5.0 + */ +export interface RawValueObject { + readonly "@value": unknown; + readonly "@type"?: string; + readonly "@language"?: string; + readonly "@direction"?: "ltr" | "rtl"; + readonly "@index"?: string; +} + +/** + * A node object in expanded JSON-LD: a reference such as + * `{ "@id": "https://example.com/" }`, or an embedded node whose other keys + * are full property IRIs with arrays of {@link RawPropertyValue}s. + * A graph object, which has a `@graph` key, also takes this shape. + * @since 2.5.0 + */ +export interface RawNodeObject { + readonly "@id"?: string; + readonly "@type"?: readonly string[]; + readonly [key: string]: unknown; +} + +/** + * A list object in expanded JSON-LD, used for properties whose values are + * ordered, such as `{ "@list": [{ "@value": 1 }, { "@value": 2 }] }`. + * @since 2.5.0 + */ +export interface RawListObject { + readonly "@list": readonly RawPropertyValue[]; + readonly "@index"?: string; +} + +/** + * A single value of a property in expanded JSON-LD, as returned by the + * `getRawPropertyValues()` function generated by `@fedify/vocab-tools`. + * Narrow it with the `in` operator, e.g., `"@value" in value`. + * @since 2.5.0 + */ +export type RawPropertyValue = RawValueObject | RawNodeObject | RawListObject; diff --git a/packages/vocab-runtime/tsdown.config.ts b/packages/vocab-runtime/tsdown.config.ts index 49be94738..3939a22d5 100644 --- a/packages/vocab-runtime/tsdown.config.ts +++ b/packages/vocab-runtime/tsdown.config.ts @@ -9,6 +9,7 @@ export default [ "src/internal.ts", "src/internal/jsonld-cache.ts", "src/internal/portable-dereference.ts", + "src/internal/raw-property.ts", "src/internal/signed-representation.ts", "src/jsonld.ts", "src/temporal.ts", From 05451edd96b86eb94b68f0d8c1069fb29ae2c4b7 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 05:21:57 +0900 Subject: [PATCH 02/35] Generate raw property readers in vocab modules Every module generated by @fedify/vocab-tools, including @fedify/vocab, now exports getRawPropertyValues() and getRawPropertyValue(), which read a property of a generated object by its full IRI and return its values in expanded JSON-LD. This lets applications read properties that Fedify has no accessor for, such as the token Aurboda delivers in quant:structuredUrl, without depending on the JSON-LD cache. - The outermost fromJsonLd() frame retains the properties the concrete class does not know, independently of the cache and of decoding failures in other properties. Embedded objects retain their own, even when a superclass of their parent decodes them, through an internal _retainsRawProperties marker that, unlike _fromSubclass, does not leak into embedded values. - clone() and deepClone() share the retained properties. When an accessor reparses an embedded object from the cached JSON-LD, which lacks the parent's context, the properties retained from the whole document are carried over to it and to its nested objects. - For known properties, including redundant aliases, generated per-property encoders re-encode the current typed values without going through accessors, so lookups never fetch or change trust state. Nested encoding detects cycles. - Root classes implement VocabularyObject and install the raw property protocol method, so one module's functions accept objects generated into another module. Relative references in retained values are left unresolved: passing the document base to the decode-side expansion would also resolve fedify:absoluteIri values, which must never be resolved. The manual gains a section on reading unsupported properties, and the agent skills mention the functions. https://github.com/fedify-dev/fedify/issues/1272 Assisted-by: Claude Code:claude-opus-5-5 Assisted-by: Claude Code:claude-fable-5-1 --- .agents/skills/add-vocab/SKILL.md | 6 + CHANGES.md | 22 +- changes.d/vocab-tools/raw-property-values.md | 12 + changes.d/vocab/raw-property-values.md | 15 + claude-plugin/skills/fedify/SKILL.md | 10 + docs/manual/vocab.md | 156 + .../src/__snapshots__/class.test.ts.deno.snap | 18942 ++++++++++++++-- .../src/__snapshots__/class.test.ts.node.snap | 18942 ++++++++++++++-- .../src/__snapshots__/class.test.ts.snap | 18942 ++++++++++++++-- packages/vocab-tools/src/class.ts | 31 +- packages/vocab-tools/src/codec.ts | 48 +- packages/vocab-tools/src/constructor.ts | 12 +- packages/vocab-tools/src/property.ts | 10 + packages/vocab-tools/src/raw-property.ts | 374 + packages/vocab-tools/src/type.ts | 15 +- packages/vocab/src/mod.ts | 5 + packages/vocab/src/raw-property.test.ts | 396 + 17 files changed, 53441 insertions(+), 4497 deletions(-) create mode 100644 changes.d/vocab-tools/raw-property-values.md create mode 100644 changes.d/vocab/raw-property-values.md create mode 100644 packages/vocab-tools/src/raw-property.ts create mode 100644 packages/vocab/src/raw-property.test.ts diff --git a/.agents/skills/add-vocab/SKILL.md b/.agents/skills/add-vocab/SKILL.md index 863a2a043..14aa2ad63 100644 --- a/.agents/skills/add-vocab/SKILL.md +++ b/.agents/skills/add-vocab/SKILL.md @@ -63,6 +63,12 @@ The `@fedify/vocab-tools` snapshots are stored separately for Deno, Node.js, and Bun. Always update all three with the aggregate task when generated output changes; do not update only one runtime's snapshot. +Adding a property also changes what `getRawPropertyValues()` returns for its +IRI and for its `redundantProperties` aliases: they stop being retained as +unsupported properties and are encoded from the typed values instead. Mention +this in the changelog entry when applications may already be reading the +property through that function. + YAML file format ---------------- diff --git a/CHANGES.md b/CHANGES.md index cff26ddf1..bb28d0593 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -310,6 +310,17 @@ To be released. entries may not be visited. Accessor and serialization traversal costs are unchanged. [[#1243], [#1337]] + - Added `getRawPropertyValues()` and `getRawPropertyValue()` functions, + which read a property of a vocabulary object by its full IRI and return + its values in expanded JSON-LD. They let applications read properties + that Fedify has no accessor for, such as an extension used by only a few + peers, without depending on the JSON-LD serialization cache: unknown + properties are now retained when an object is decoded, including embedded + objects, and survive `clone()` and `deepClone()`. For properties Fedify + does support, the functions return the current typed values encoded back + into JSON-LD. The values are not verified, so validate them before use. + [[#1272], [#1356]] + - Added the `attributionDomains` property to `Application`, `Group`, `Organization`, `Person`, and `Service`, so applications can publish the domains an actor claims for Mastodon's `fediverse:creator` link credits @@ -342,7 +353,9 @@ To be released. [#1212]: https://github.com/fedify-dev/fedify/issues/1212 [#1241]: https://github.com/fedify-dev/fedify/pull/1241 [#1243]: https://github.com/fedify-dev/fedify/issues/1243 +[#1272]: https://github.com/fedify-dev/fedify/issues/1272 [#1337]: https://github.com/fedify-dev/fedify/pull/1337 +[#1356]: https://github.com/fedify-dev/fedify/pull/1356 ### @fedify/vocab-runtime @@ -363,8 +376,6 @@ To be released. [#1229]: https://github.com/fedify-dev/fedify/issues/1229 [#1231]: https://github.com/fedify-dev/fedify/pull/1231 -[#1272]: https://github.com/fedify-dev/fedify/issues/1272 -[#1356]: https://github.com/fedify-dev/fedify/pull/1356 ### @fedify/vocab-tools @@ -389,6 +400,13 @@ To be released. `https://w3id.org/identity/v1`. Previously, such a property compacted to a prefixed name like `dc:license` without the extra context. [[#1212], [#1241]] + - Generated vocabulary modules now export `getRawPropertyValues()` and + `getRawPropertyValue()`, which read any property of a generated object + by its full IRI, and their root classes implement `VocabularyObject` from + `@fedify/vocab-runtime`. Decoding retains the properties a class does not + know, so third-party vocabulary modules get the same access to + unsupported properties as `@fedify/vocab`. The functions accept objects + from any generated module. [[#1272], [#1356]] - Made the generated `xsd:string` decoder skip JSON-LD values whose `@value` is not a string instead of placing them in string accessors. Malformed remote values no longer leak numbers or booleans into properties such as diff --git a/changes.d/vocab-tools/raw-property-values.md b/changes.d/vocab-tools/raw-property-values.md new file mode 100644 index 000000000..f444ea68b --- /dev/null +++ b/changes.d/vocab-tools/raw-property-values.md @@ -0,0 +1,12 @@ +--- +links: + '#1272': https://github.com/fedify-dev/fedify/issues/1272 + '#1356': https://github.com/fedify-dev/fedify/pull/1356 +--- + - Generated vocabulary modules now export `getRawPropertyValues()` and + `getRawPropertyValue()`, which read any property of a generated object + by its full IRI, and their root classes implement `VocabularyObject` from + `@fedify/vocab-runtime`. Decoding retains the properties a class does not + know, so third-party vocabulary modules get the same access to + unsupported properties as `@fedify/vocab`. The functions accept objects + from any generated module. [[#1272], [#1356]] diff --git a/changes.d/vocab/raw-property-values.md b/changes.d/vocab/raw-property-values.md new file mode 100644 index 000000000..e0a32300a --- /dev/null +++ b/changes.d/vocab/raw-property-values.md @@ -0,0 +1,15 @@ +--- +links: + '#1272': https://github.com/fedify-dev/fedify/issues/1272 + '#1356': https://github.com/fedify-dev/fedify/pull/1356 +--- + - Added `getRawPropertyValues()` and `getRawPropertyValue()` functions, + which read a property of a vocabulary object by its full IRI and return + its values in expanded JSON-LD. They let applications read properties + that Fedify has no accessor for, such as an extension used by only a few + peers, without depending on the JSON-LD serialization cache: unknown + properties are now retained when an object is decoded, including embedded + objects, and survive `clone()` and `deepClone()`. For properties Fedify + does support, the functions return the current typed values encoded back + into JSON-LD. The values are not verified, so validate them before use. + [[#1272], [#1356]] diff --git a/claude-plugin/skills/fedify/SKILL.md b/claude-plugin/skills/fedify/SKILL.md index c6385e05b..e965ca0eb 100644 --- a/claude-plugin/skills/fedify/SKILL.md +++ b/claude-plugin/skills/fedify/SKILL.md @@ -277,6 +277,16 @@ overrides: `deepClone()` snapshots the existing indices of large sparse arrays. Entries added during copying are not visited, so their nested objects may remain shared. Copying preserves array length and holes. +To read a property that has no typed accessor, such as an application's +extension, use `getRawPropertyValues(object, propertyIri)` or +`getRawPropertyValue()` from `@fedify/vocab` (Fedify 2.5.0 and later) instead +of digging through `toJsonLd()` output. Pass the full property IRI, never a +compact IRI like `as:content` or a term; prefixes are not expanded. The +results are untyped expanded JSON-LD values, unverified like any received +data, so validate them before use. For properties Fedify does support, the +functions return the current typed values encoded back, not the received +document. + > [!WARNING] > `crossOrigin: "trust"` on vocabulary deserialization trusts embedded > objects without re-fetching. Treat it as you would diff --git a/docs/manual/vocab.md b/docs/manual/vocab.md index b244425c1..2e81d1e51 100644 --- a/docs/manual/vocab.md +++ b/docs/manual/vocab.md @@ -1348,9 +1348,165 @@ to determine whether property accessors need to perform additional validation or fetching. +Reading unsupported properties +------------------------------ + +*This API is available since Fedify 2.5.0.* + +Peers sometimes send properties that Fedify has no accessor for, such as an +extension that only a few implementations understand. The +`getRawPropertyValues()` function reads such a property by its full IRI and +returns its values in [expanded JSON-LD][]: + +~~~~ typescript twoslash +import { getRawPropertyValues, Note } from "@fedify/vocab"; + +const note = await Note.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + { "quant": "https://w3id.org/quantpub#" }, + ], + "type": "Note", + "content": "My morning run", + "quant:structuredUrl": { "id": "https://example.com/runs/1?token=abc" }, +}); + +const values = await getRawPropertyValues( + note, + "https://w3id.org/quantpub#structuredUrl", +); +// [{ "@id": "https://example.com/runs/1?token=abc" }] +~~~~ + +The lookup goes through JSON-LD expansion, so it does not matter which prefix +or term the sender used for the property; `"q:structuredUrl"` under +a `"q"` prefix for the same namespace gives the same result. A property that +the object does not have gives an empty array. + +The `getRawPropertyValue()` function returns only the first value, or `null` +if there is none. It does not throw when there are more values: JSON-LD does +not order the values of a property unless it is a list, so the first value is +not more significant than the others. + +~~~~ typescript twoslash +import { getRawPropertyValue, Note } from "@fedify/vocab"; +const note = new Note({}); +// ---cut-before--- +const value = await getRawPropertyValue( + note, + "https://w3id.org/quantpub#structuredUrl", +); +if (value != null && "@id" in value && typeof value["@id"] === "string") { + const url = new URL(value["@id"]); +} +~~~~ + +Both functions accept a `URL` as well as a string, and work for the objects of +any vocabulary module generated by `@fedify/vocab-tools`. Their parameter type +is `VocabularyObject`, an interface that all generated classes implement. + +[expanded JSON-LD]: https://www.w3.org/TR/json-ld11/#expanded-document-form + +### Value shapes + +The values are untyped, which is what *raw* refers to in the function names. +Each value takes one of the following shapes, which the `RawPropertyValue` +type describes. Narrow it with the `in` operator. + +Value object +: A literal, such as `{ "@value": "Hello" }`, + `{ "@value": "Bonjour", "@language": "fr" }`, or + `{ "@value": "2024-01-01T00:00:00Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }`. + A JSON literal has `"@type": "@json"`, and its `@value` is the JSON value + itself. + +Node object +: A reference, such as `{ "@id": "https://example.com/" }`, or an embedded + node, whose `@type` is an array of type IRIs and whose other keys are full + property IRIs with arrays of values. + +List object +: The single value of a property whose values are ordered, such as + `{ "@list": [{ "@value": 1 }, { "@value": 2 }] }`. + +The result is a deep copy, so changing it does not affect the object. + +### Supported and unsupported properties + +The functions accept the IRIs of properties that Fedify does support, too, +but they get the values differently: + + - For a property that the object's class has no accessor for, the values + are the ones retained when the object was decoded by `fromJsonLd()`. + Objects constructed locally have none. The retained values are shared + with copies made by `clone()` and `deepClone()`, even when the copy + replaces other values. Relative references in them are not resolved + against the document's base, because Fedify cannot tell which of an + unknown property's values are meant to be IRIs; resolve them yourself if + the property calls for it. + - For a property that the object's class has an accessor for, including an + alternative IRI that Fedify reads for the same property, the values are + the current typed values encoded back into expanded JSON-LD. + +The second case is not a round trip of the received document. Values that +failed to decode are missing, date-times and other lexical forms are +normalized, relative IRIs are resolved, `@direction` is lost, and values given +under an alternative IRI are returned for the canonical one as well. The +values also reflect what happened to the object after it was decoded: +replacements made by `clone()`, and objects that [property hydration] fetched +and cached in place of embedded ones. Encoding a property whose values are +nested objects does not include the unknown properties of those nested +objects; read them from the nested objects themselves. + +Whether a property is supported depends on the class of the object, not on +the vocabulary as a whole. A `Person` has no accessor for `Question`'s +`oneOf`, so `oneOf` on a `Person` is retained as an unsupported property. +When a later Fedify release adds an accessor for a property you read this +way, the same call keeps working, but it returns encoded values from then on. + +[property hydration]: #property-hydration + +### Property IRIs + +The property IRI has to be absolute. An empty string, a JSON-LD keyword such +as `"@id"`, a blank node identifier, a term such as `"content"`, and a relative +reference make the functions throw a `TypeError`. Prefixes are never expanded: +`"as:content"` is a valid IRI with the `as:` scheme, so it is looked up +literally and normally matches nothing. Since that is almost always a +mistake, an IRI with a scheme other than `http:` or `https:` is logged as +a warning under the `["fedify", "vocab"]` category, with a suggestion when the +prefix is a well-known one. The [`raw-property-iri-invalid`] lint rule +reports these mistakes before the code runs. + +The IRI is matched as it is first, and then as normalized by the [WHATWG URL] +parser, so `"HTTPS://W3ID.org/quantpub#structuredUrl"` finds the same property +as its lowercase form. + +[`raw-property-iri-invalid`]: ./lint.md#raw-property-iri-invalid +[WHATWG URL]: https://url.spec.whatwg.org/ + +### Security considerations + +The values are what the sender put in the document. They are not covered by +the [origin-based security model](#origin-based-security-model), the trust +tracking of property accessors, or the verification of +[FEP-ef61 portable objects](#fep-ef61-portable-objects). IRIs in them are +never dereferenced. Validate the values before you use them, and remember +that an embedded node may claim any `@id`. + +Retained values stay in memory as long as the object does. If a property +carries a secret, such as a capability token, avoid logging the values. + +*[IRI]: Internationalized Resource Identifier + + Extending the vocabulary ------------------------ +To read a property that Fedify does not support, you do not need to extend +the vocabulary: see [*Reading unsupported +properties*](#reading-unsupported-properties). + While Fedify's vocabulary API offers many advantages, it has a limitation due to its implementation through code generation: it is difficult to extend with custom types or custom properties that are not included in the Activity diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 9302bedc8..2e6e7de68 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -27,7 +27,9 @@ import { parseIri, parseJsonLdId, type PortableObjectVerifier, - type RemoteDocument + type RawPropertyValue, + type RemoteDocument, + type VocabularyObject } from \\"@fedify/vocab-runtime\\"; import { compactJsonLdCache, @@ -56,6 +58,16 @@ import { rejectMalformedCompatibleReference, warnUnverifiableEmbeddedObject } from \\"@fedify/vocab-runtime/internal/portable-dereference\\"; +import { + createRawPropertyEncodingOptions, + encodeNestedVocabularyValue, + expandRawPropertyValue, + RAW_PROPERTY_PROTOCOL, + type RawPropertyRequest, + readRawPropertyValues, + retainRawProperties, + type RetainedRawProperties +} from \\"@fedify/vocab-runtime/internal/raw-property\\"; import { enterSignedValueScope, resolveSignedValues, @@ -369,6 +381,221 @@ function deepCloneGraph(source: object, root: T): T { return root; } +type RawPropertyEncoder = ( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, +) => Promise; + +interface RawPropertyDescriptor { + readonly canonicalIri: string; + readonly encode: RawPropertyEncoder; + readonly values: (object: object) => readonly unknown[]; +} + +// Unknown properties retained while decoding, keyed by the decoded object: +const retainedRawProperties = new WeakMap(); + +// Encoders of the properties each generated class declares, keyed by the +// class's prototype and then by the property IRIs, including aliases: +const rawPropertyDescriptors = new Map< + object, + ReadonlyMap +>(); + +function getRawPropertyDescriptor( + object: object, + iri: string, +): RawPropertyDescriptor | undefined { + let prototype: object | null = globalThis.Object.getPrototypeOf(object); + while (prototype != null) { + const descriptor = rawPropertyDescriptors.get(prototype)?.get(iri); + if (descriptor != null) return descriptor; + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return undefined; +} + +function copyRawProperties(source: object, destination: object): void { + const retained = retainedRawProperties.get(source); + if (retained == null) retainedRawProperties.delete(destination); + else retainedRawProperties.set(destination, retained); +} + +function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { + if ( + source == null || destination == null || + typeof source !== \\"object\\" || typeof destination !== \\"object\\" || + !(RAW_PROPERTY_PROTOCOL in source) || + globalThis.Object.getPrototypeOf(source) !== + globalThis.Object.getPrototypeOf(destination) + ) { + return false; + } + const sourceId = (source as unknown as { id: URL | null }).id; + const destinationId = (destination as unknown as { id: URL | null }).id; + return sourceId?.href === destinationId?.href; +} + +// Copies the retained unknown properties of a decoded object and of the +// objects nested in it to a copy of the same graph that was decoded again, +// pairing nested objects by property and position: +function copyRawPropertiesDeep( + source: object, + destination: object, + visited: Set = new Set(), +): void { + if (visited.has(destination)) return; + visited.add(destination); + copyRawProperties(source, destination); + if (!isSameRawPropertyNode(source, destination)) return; + const descriptors = new Set(); + let prototype: object | null = globalThis.Object.getPrototypeOf(destination); + while (prototype != null) { + for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { + descriptors.add(descriptor); + } + prototype = globalThis.Object.getPrototypeOf(prototype); + } + for (const descriptor of descriptors) { + const sources = descriptor.values(source); + const destinations = descriptor.values(destination); + const length = globalThis.Math.min(sources.length, destinations.length); + for (let i = 0; i < length; i++) { + if ( + sources[i] !== destinations[i] && + isSameRawPropertyNode(sources[i], destinations[i]) + ) { + copyRawPropertiesDeep( + sources[i] as object, + destinations[i] as object, + visited, + ); + } + } + } +} + +async function readRawProperty( + object: object, + request: RawPropertyRequest, + contextLoader: DocumentLoader, +): Promise { + const retained = retainedRawProperties.get(object); + for (const iri of request.candidates) { + const descriptor = getRawPropertyDescriptor(object, iri); + if (descriptor != null) { + const value = await descriptor.encode( + object, + createRawPropertyEncodingOptions(request.stack, contextLoader), + ); + return value === undefined ? [] : await expandRawPropertyValue( + descriptor.canonicalIri, + value, + contextLoader, + ); + } + if (retained != null && globalThis.Object.hasOwn(retained, iri)) { + return retained[iri]; + } + } + return []; +} + +/** + * Gets the values of a property of a vocabulary object in expanded JSON-LD, + * looking the property up by its full IRI. This works for properties that + * have no typed accessor as well as for those that do. + * + * *Raw* means untyped expanded JSON-LD values, such as + * \`{ \\"@value\\": \\"Hello\\" }\` or \`{ \\"@id\\": \\"https://example.com/\\" }\`, as + * opposed to the values that typed accessors return. It does not mean the + * received document: + * + * - For a property that the object's class has no accessor for, the result + * is the values retained when the object was decoded by \`fromJsonLd()\`. + * Objects constructed locally have none. + * - For a property that the class has an accessor for, including a + * redundant alias of such a property, the result is the current typed + * values encoded back into expanded JSON-LD. It reflects \`clone()\` + * replacements and objects fetched by dereferencing accessors, and it can + * differ from the received values: for example, values that failed to + * decode are missing, and lexical forms such as date-times are + * normalized. When a later release adds an accessor for a property, + * the result for that property switches from the retained values to the + * encoded ones. + * + * The values are not verified in any way, and IRIs in them are never + * dereferenced. Validate them before use, as with any other data received + * from a remote server. The result is a deep copy, so modifying it does not + * affect the object. + * + * The IRI is matched as given, and then as normalized by the WHATWG URL + * parser. Prefixes are never expanded: \`\\"as:content\\"\` is a valid IRI with + * the \`as:\` scheme, so it normally matches nothing. An IRI whose scheme is + * not \`http:\` or \`https:\` is therefore logged as a warning under the + * \`[\\"fedify\\", \\"vocab\\"]\` category. + * + * \`\`\`typescript ignore + * const values = await getRawPropertyValues( + * note, + * \\"https://w3id.org/quantpub#structuredUrl\\", + * ); + * for (const value of values) { + * if (\\"@id\\" in value && typeof value[\\"@id\\"] === \\"string\\") { + * console.log(new URL(value[\\"@id\\"])); + * } + * } + * \`\`\` + * + * @param object The vocabulary object to read. It can be an object of any + * module generated by \`@fedify/vocab-tools\`. + * @param propertyIri The full IRI of the property. + * @returns The values of the property, or an empty array if it has none. + * @throws {TypeError} If \`propertyIri\` is not an absolute IRI, e.g., an + * empty string, a JSON-LD keyword such as \`\\"@id\\"\`, a + * blank node identifier, a term, or a relative + * reference; if \`object\` is not a generated vocabulary + * object; or if encoding the values of a known property + * meets a cycle of objects. + * @since 2.5.0 + */ +export function getRawPropertyValues( + object: VocabularyObject, + propertyIri: string | URL, +): Promise { + return readRawPropertyValues(object, propertyIri, \\"getRawPropertyValues\\"); +} + +/** + * Gets the first value of a property of a vocabulary object in expanded + * JSON-LD, looking the property up by its full IRI. It is equivalent to + * \`(await getRawPropertyValues(object, propertyIri))[0] ?? null\`; see + * {@link getRawPropertyValues} for how the values are obtained. + * + * It does not throw when the property has multiple values. JSON-LD does not + * order the values of a property unless it is a list, so the first value is + * not more significant than the others. A list property has a single value, + * the \`{ \\"@list\\": [...] }\` object. + * + * @param object The vocabulary object to read. It can be an object of any + * module generated by \`@fedify/vocab-tools\`. + * @param propertyIri The full IRI of the property. + * @returns The first value of the property, or \`null\` if it has none. + * @throws {TypeError} In the same cases as {@link getRawPropertyValues}. + * @since 2.5.0 + */ +export async function getRawPropertyValue( + object: VocabularyObject, + propertyIri: string | URL, +): Promise { + const values = await readRawPropertyValues( + object, + propertyIri, + \\"getRawPropertyValue\\", + ); + return values[0] ?? null; +} + function isValidLanguageTag(language: string): boolean { try { new Intl.Locale(normalizeLanguageTag(language)); @@ -451,7 +678,7 @@ import * as _ppM0 from \\"./preprocessors.ts\\"; * {@link OrderedCollection}. * */ -export class Object { +export class Object implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -467,6 +694,14 @@ export class Object { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -2132,6 +2367,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -2187,6 +2426,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length < vocabSparseArrayMinimumLength ? this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.slice() : vocabCopyPropertyArray(this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment);clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = vocabCopyTrustSet( this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, @@ -3771,9 +4011,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -4483,6 +4724,1380 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Object, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#attachment\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Link ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#attachment\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#attributedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#attributedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#audience\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#audience\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#content\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#content\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#context\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3mhZzGXSpQ431mBSz2kvych22v4e_context; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#context\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#name\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endTime\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endTime\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#generator\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#generator\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#icon\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#icon\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#image\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#image\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#inReplyTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#inReplyTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#location\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#location\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preview\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Link ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preview\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#published\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_5e258TDXtuhaFRPZiGoDfEpjdMr_published) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_5e258TDXtuhaFRPZiGoDfEpjdMr_published; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#published\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#replies\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_7UpwM3JWcXhADcscukEehBorf6k_replies) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_7UpwM3JWcXhADcscukEehBorf6k_replies; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#replies\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#shares\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3kAfck9PcEYt2L7xug5y99YPbANs_shares; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#shares\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#likes\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#likes\\", descriptor); + + descriptor = { + canonicalIri: \\"http://fedibird.com/ns#emojiReactions\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions; + }, + }; + descriptors.set(\\"http://fedibird.com/ns#emojiReactions\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#startTime\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2w3Jmue4up8iVDUA51WZqomEF438_startTime) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2w3Jmue4up8iVDUA51WZqomEF438_startTime; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#startTime\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#summary\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#summary\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#tag\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_5chuqj6s95p5gg2sk1HntGfarRf_tag; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#tag\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#updated\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#updated\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#url\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + + let element = ( +v instanceof URL ?{ \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#url\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#to\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#to\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#bto\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#bto\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#cc\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#cc\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#bcc\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#bcc\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#mediaType\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#duration\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#duration\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#duration\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#sensitive\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#sensitive\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#source\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#source\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#proof\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push({ \\"@graph\\": element }); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; + }, + }; + descriptors.set(\\"https://w3id.org/security#proof\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionPolicy\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionPolicy\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#approvedBy\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#approvedBy\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#likeAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#likeAuthorization\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#replyAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#replyAuthorization\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#announceAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#announceAuthorization\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/22cd#translations\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations; + }, + }; + descriptors.set(\\"https://w3id.org/fep/22cd#translations\\", descriptor); + + descriptor = { + canonicalIri: \\"http://purl.org/dc/terms/license\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + }, + }; + descriptors.set(\\"http://purl.org/dc/terms/license\\", descriptor); +descriptors.set(\\"https://schema.org/license\\", descriptor); +descriptors.set(\\"http://creativecommons.org/ns#license\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchAttachment( url: URL, @@ -4886,6 +6501,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#attachment_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -4898,6 +6514,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -5369,6 +6989,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#attribution_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -5381,6 +7002,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -5533,6 +7158,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#attribution_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -5545,6 +7171,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -5955,6 +7585,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#audience_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -5967,6 +7598,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -6118,6 +7753,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#audience_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -6130,6 +7766,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -6593,6 +8233,7 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#context_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -6605,6 +8246,10 @@ get contents(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7075,6 +8720,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#generator_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -7087,6 +8733,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7520,6 +9170,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#icon_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -7532,6 +9183,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7684,6 +9339,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#icon_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -7696,6 +9352,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8129,6 +9789,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#image_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -8141,6 +9802,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8293,6 +9958,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#image_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -8305,6 +9971,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8730,6 +10400,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#replyTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -8742,6 +10413,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8893,6 +10568,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#replyTarget_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -8905,6 +10581,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9330,6 +11010,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#location_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -9342,6 +11023,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9493,6 +11178,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#location_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -9505,6 +11191,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9929,6 +11619,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#preview_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -9941,6 +11632,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10091,6 +11786,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#preview_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -10103,6 +11799,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10526,6 +12226,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#replies_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -10538,6 +12239,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10953,6 +12658,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#shares_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -10965,6 +12671,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11380,6 +13090,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#likes_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -11392,6 +13103,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11801,6 +13516,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#emojiReactions_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -11813,6 +13529,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12283,6 +14003,7 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#tag_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -12295,6 +14016,10 @@ get summaries(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12739,6 +14464,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#to_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -12751,6 +14477,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12902,6 +14632,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#to_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -12914,6 +14645,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13324,6 +15059,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#bto_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -13336,6 +15072,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13487,6 +15227,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#bto_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -13499,6 +15240,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13909,6 +15654,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#cc_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -13921,6 +15667,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14072,6 +15822,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#cc_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -14084,6 +15835,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14494,6 +16249,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#bcc_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -14506,6 +16262,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14657,6 +16417,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#bcc_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -14669,6 +16430,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15142,6 +16907,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#proof_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -15154,6 +16920,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15304,6 +17074,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#proof_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -15316,6 +17087,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15765,6 +17540,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#likeAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -15777,6 +17553,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16186,6 +17966,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#replyAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -16198,6 +17979,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16607,6 +18392,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#announceAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -16619,6 +18405,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -17536,8 +19326,21 @@ get licenses(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Link ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17556,8 +19359,29 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17576,8 +19400,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17596,6 +19425,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -17619,8 +19449,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17639,6 +19478,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -17662,6 +19502,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -17685,8 +19526,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17705,8 +19555,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17725,8 +19580,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17745,8 +19605,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17765,8 +19634,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17785,8 +19663,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17805,6 +19692,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -17828,8 +19716,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_7UpwM3JWcXhADcscukEehBorf6k_replies) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17848,8 +19741,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17868,8 +19766,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17888,8 +19791,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17908,6 +19816,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -17931,6 +19840,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -17954,8 +19864,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17974,6 +19893,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -17997,8 +19917,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + let element = ( - v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18017,8 +19942,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18037,8 +19967,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18057,8 +19992,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18077,8 +20017,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18097,6 +20042,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + let element = ( { \\"@value\\": v } ); @@ -18117,6 +20063,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#duration\\", @@ -18140,6 +20087,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive) { + let element = ( { \\"@value\\": v } ); @@ -18160,8 +20108,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18180,8 +20133,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18200,8 +20158,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18220,6 +20183,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -18240,8 +20204,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18260,8 +20229,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18280,8 +20254,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18300,8 +20279,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18320,6 +20304,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -18441,6 +20426,8 @@ get licenses(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -18874,16 +20861,31 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"http://schema.org#PropertyValue\\") ? await PropertyValue.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -18925,23 +20927,48 @@ get licenses(): (URL)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -18982,7 +21009,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19058,12 +21090,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19172,12 +21214,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19241,7 +21293,12 @@ get licenses(): (URL)[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19305,7 +21362,12 @@ get licenses(): (URL)[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19348,12 +21410,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19396,12 +21468,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19444,12 +21526,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19523,7 +21615,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19564,7 +21661,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19605,7 +21707,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19646,7 +21753,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19755,12 +21867,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19829,7 +21951,12 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19870,7 +21997,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19911,7 +22043,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19952,7 +22089,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19993,7 +22135,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20113,7 +22260,12 @@ get licenses(): (URL)[] { const decoded = await Source.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20159,7 +22311,12 @@ get licenses(): (URL)[] { const decoded = await DataIntegrityProof.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20191,7 +22348,12 @@ get licenses(): (URL)[] { const decoded = await InteractionPolicy.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20261,7 +22423,12 @@ get licenses(): (URL)[] { const decoded = await LikeAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20302,7 +22469,12 @@ get licenses(): (URL)[] { const decoded = await ReplyAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20343,7 +22515,12 @@ get licenses(): (URL)[] { const decoded = await AnnounceAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20375,7 +22552,12 @@ get licenses(): (URL)[] { const decoded = await Translation.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20429,6 +22611,16 @@ get licenses(): (URL)[] { } instance.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = _2rzkBRS4gNPrkJk9DohHAMUAxA2d; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Object.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -21453,6 +23645,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -21518,9 +23714,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -21708,6 +23905,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -21840,6 +24039,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Emoji)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -21847,6 +24049,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Emoji.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -22019,6 +24231,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -22132,9 +24348,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -22262,6 +24479,112 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ChatMessage).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ChatMessage).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#quoteUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ChatMessage).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ \\"@value\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ChatMessage).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); +descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); +descriptors.set(\\"http://fedibird.com/ns#quoteUri\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quoteAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ChatMessage).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ChatMessage).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchQuote( url: URL, @@ -22631,6 +24954,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -22643,6 +24967,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -23075,6 +25403,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -23087,6 +25416,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -23262,8 +25595,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -23282,6 +25620,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { \\"@value\\": formatIri(v) } ); @@ -23306,8 +25645,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -23392,6 +25736,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -23524,6 +25870,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ChatMessage)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -23555,7 +25904,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -23635,7 +25989,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -23652,6 +26011,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ChatMessage.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -24234,6 +26603,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -24707,9 +27080,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -24909,6 +27283,232 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#actor\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#actor\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#object\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#object\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#target\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#target\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#result\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#result\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#origin\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_25zu2s3VxVujgEKqrDycjE284XQR_origin) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_25zu2s3VxVujgEKqrDycjE284XQR_origin; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#origin\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#instrument\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#instrument\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchActor( url: URL, @@ -25338,6 +27938,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#actor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -25350,6 +27951,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -25502,6 +28107,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#actor_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -25514,6 +28120,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -25925,6 +28535,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#object_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -25937,6 +28548,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -26089,6 +28704,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#object_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -26101,6 +28717,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -26515,6 +29135,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#target_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -26527,6 +29148,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -26682,6 +29307,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#target_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -26694,6 +29320,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27105,6 +29735,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#result_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -27117,6 +29748,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27269,6 +29904,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#result_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -27281,6 +29917,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27693,6 +30333,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#origin_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -27705,6 +30346,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27858,6 +30503,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#origin_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -27870,6 +30516,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28280,6 +30930,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#instrument_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -28292,6 +30943,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28443,6 +31098,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#instrument_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -28455,6 +31111,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28546,8 +31206,29 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28566,8 +31247,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28586,8 +31272,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28606,8 +31297,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28626,8 +31322,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28646,8 +31347,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28732,6 +31438,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -29004,6 +31712,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Activity)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -29036,23 +31747,48 @@ const base = getDeepCloneDescriptor(this.prototype)!; typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -29093,7 +31829,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29134,7 +31875,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29175,7 +31921,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29216,7 +31967,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29257,7 +32013,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29274,6 +32035,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Activity.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -29558,6 +32329,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -29629,9 +32404,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -29806,6 +32582,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -29938,6 +32716,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof EmojiReact)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -29945,6 +32726,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + EmojiReact.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -30005,7 +32796,7 @@ instruments?: (Object | URL)[];} }; /** A pair of property name and value. */ -export class PropertyValue { +export class PropertyValue implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -30021,6 +32812,14 @@ export class PropertyValue { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -30166,6 +32965,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -30205,6 +33008,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if (\\"name\\" in values && values.name != null) { @@ -30250,9 +33054,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -30308,6 +33113,94 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: PropertyValue, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#name\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as PropertyValue).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as PropertyValue).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); + + descriptor = { + canonicalIri: \\"http://schema.org#value\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as PropertyValue).#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as PropertyValue).#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value; + }, + }; + descriptors.set(\\"http://schema.org#value\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The name of a property. */ @@ -30424,6 +33317,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -30447,6 +33341,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -30535,6 +33430,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://schema.org#value\\",\\"https://www.w3.org/ns/activitystreams#name\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -30736,6 +33633,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value = _2cSy2magg4iZ7zLaG8U7DiJMoCkx_value; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + PropertyValue.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -30851,7 +33758,7 @@ deepCloneDescriptors.set(this.prototype, { }; /** A quantity with a unit of measure. */ -export class Measure { +export class Measure implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -30867,6 +33774,14 @@ export class Measure { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -31012,6 +33927,10 @@ unit?: string | null;numericalValue?: Decimal | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -31051,6 +33970,7 @@ unit?: string | null;numericalValue?: Decimal | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.length < vocabSparseArrayMinimumLength ? this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.slice() : vocabCopyPropertyArray(this.#_27fgyFbosTtMAhuepJH8K3ZGURT6); if (\\"unit\\" in values && values.unit != null) { @@ -31096,9 +34016,10 @@ unit?: string | null;numericalValue?: Decimal | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -31154,6 +34075,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Measure, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Measure).#_27fgyFbosTtMAhuepJH8K3ZGURT6) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Measure).#_27fgyFbosTtMAhuepJH8K3ZGURT6; + }, + }; + descriptors.set(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Measure).#_1GQx8o2RgxRs4x9G5uT39XYBv7D) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#decimal\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Measure).#_1GQx8o2RgxRs4x9G5uT39XYBv7D; + }, + }; + descriptors.set(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The name of the unit, according to the Ontology of units of Measure * classification. The recommended unit for countable items is \`\\"one\\"\`. @@ -31268,6 +34274,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_27fgyFbosTtMAhuepJH8K3ZGURT6) { + let element = ( { \\"@value\\": v } ); @@ -31288,6 +34295,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#decimal\\", @@ -31366,6 +34374,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\",\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -31560,6 +34570,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = _1GQx8o2RgxRs4x9G5uT39XYBv7D; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Measure.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -31777,6 +34797,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -31876,9 +34900,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -31984,6 +35009,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as AnnounceAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as AnnounceAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as AnnounceAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as AnnounceAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -32352,6 +35451,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -32364,6 +35464,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -32772,6 +35876,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -32784,6 +35889,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -32933,8 +36042,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -32953,8 +36067,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -33039,6 +36158,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -33171,6 +36292,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof AnnounceAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -33202,7 +36326,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -33243,7 +36372,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -33260,6 +36394,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + AnnounceAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -33438,6 +36582,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -33509,9 +36657,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -33686,6 +36835,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -33818,6 +36969,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof AnnounceRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -33825,6 +36979,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + AnnounceRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -33892,7 +37056,7 @@ instruments?: (Object | URL)[];} * for details. * */ -export class InteractionPolicy { +export class InteractionPolicy implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -33908,6 +37072,14 @@ export class InteractionPolicy { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -34095,6 +37267,10 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -34134,6 +37310,7 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature = this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length < vocabSparseArrayMinimumLength ? this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.slice() : vocabCopyPropertyArray(this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature); if (\\"canFeature\\" in values && values.canFeature != null) { @@ -34221,9 +37398,10 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -34389,6 +37567,198 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: InteractionPolicy, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#canFeature\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#canFeature\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#canLike\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#canLike\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#canReply\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#canReply\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#canAnnounce\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#canAnnounce\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#canQuote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#canQuote\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The sub-policy specifying who can feature the actor in a * {@link FeaturedCollection}. @@ -34513,8 +37883,13 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34533,8 +37908,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34553,8 +37933,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34573,8 +37958,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34593,8 +37983,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34693,6 +38088,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://gotosocial.org/ns#canAnnounce\\",\\"https://gotosocial.org/ns#canLike\\",\\"https://gotosocial.org/ns#canQuote\\",\\"https://gotosocial.org/ns#canReply\\",\\"https://w3id.org/fep/7aa9#canFeature\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -34843,7 +38240,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34875,7 +38277,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34907,7 +38314,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34939,7 +38351,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34971,7 +38388,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34988,6 +38410,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote = _LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + InteractionPolicy.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -35181,7 +38613,7 @@ deepCloneDescriptors.set(this.prototype, { * for details. * */ -export class InteractionRule { +export class InteractionRule implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -35197,6 +38629,14 @@ export class InteractionRule { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -35438,6 +38878,10 @@ manualApprovals?: (URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -35479,6 +38923,7 @@ manualApprovals?: (URL)[];} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length < vocabSparseArrayMinimumLength ? this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.slice() : vocabCopyPropertyArray(this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval); if (\\"automaticApproval\\" in values && values.automaticApproval != null) { @@ -35618,9 +39063,10 @@ manualApprovals?: (URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -35722,6 +39168,88 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: InteractionRule, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#automaticApproval\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionRule).#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionRule).#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#automaticApproval\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#manualApproval\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionRule).#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionRule).#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#manualApproval\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** URIs of actors or collections whose interactions are automatically * approved without requiring manual review by the post author. @@ -35809,6 +39337,7 @@ get manualApprovals(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -35829,6 +39358,7 @@ get manualApprovals(): (URL)[] { array = []; for (const v of this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -35904,6 +39434,8 @@ get manualApprovals(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#manualApproval\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -36097,6 +39629,16 @@ get manualApprovals(): (URL)[] { } instance.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = _sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + InteractionRule.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -36325,6 +39867,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -36424,9 +39970,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -36532,6 +40079,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as LikeAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as LikeAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as LikeAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as LikeAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -36900,6 +40521,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -36912,6 +40534,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -37320,6 +40946,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -37332,6 +40959,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -37481,8 +41112,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -37501,8 +41137,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -37587,6 +41228,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -37719,6 +41362,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof LikeAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -37750,7 +41396,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -37791,7 +41442,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -37808,6 +41464,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + LikeAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -37985,6 +41651,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -38056,9 +41726,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -38233,6 +41904,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -38365,6 +42038,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof LikeRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -38372,6 +42048,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + LikeRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -38533,6 +42219,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -38632,9 +42322,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -38740,6 +42431,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ReplyAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ReplyAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ReplyAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ReplyAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -39108,6 +42873,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -39120,6 +42886,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -39528,6 +43298,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -39540,6 +43311,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -39689,8 +43464,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -39709,8 +43489,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -39795,6 +43580,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -39927,6 +43714,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ReplyAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -39958,7 +43748,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -39999,7 +43794,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -40016,6 +43816,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ReplyAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -40193,6 +44003,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -40264,9 +44078,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -40441,6 +44256,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -40573,6 +44390,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ReplyRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -40580,6 +44400,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ReplyRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -40741,6 +44571,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -40840,9 +44674,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -40948,6 +44783,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as QuoteAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as QuoteAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as QuoteAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as QuoteAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -41315,6 +45224,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -41327,6 +45237,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -41735,6 +45649,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -41747,6 +45662,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -41896,8 +45815,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -41916,8 +45840,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -42002,6 +45931,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -42134,6 +46065,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof QuoteAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -42165,7 +46099,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -42206,7 +46145,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -42223,6 +46167,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + QuoteAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -42400,6 +46354,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -42471,9 +46429,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -42648,6 +46607,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -42780,6 +46741,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof QuoteRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -42787,6 +46751,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + QuoteRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -42854,7 +46828,7 @@ instruments?: (Object | URL)[];} * Targets [draft revision 6d0d6559](https://codeberg.org/fediverse/fep/src/commit/6d0d6559054baeb7b71a5f2bdc14fc4c09b66f39/fep/22cd/fep-22cd.md). * */ -export class Translation { +export class Translation implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -42870,6 +46844,14 @@ export class Translation { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -43171,6 +47153,10 @@ urls?: ((URL | Link))[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -43212,6 +47198,7 @@ urls?: ((URL | Link))[];} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.length < vocabSparseArrayMinimumLength ? this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.slice() : vocabCopyPropertyArray(this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG); if (\\"language\\" in values && values.language != null) { @@ -43413,9 +47400,10 @@ urls?: ((URL | Link))[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -43561,6 +47549,235 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Translation, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://schema.org/inLanguage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_diXuPmFWiEqfLPhhrxg6Xc7ixZG) { + + let element = ( +{ \\"@value\\": v.baseName } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_diXuPmFWiEqfLPhhrxg6Xc7ixZG; + }, + }; + descriptors.set(\\"https://schema.org/inLanguage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://schema.org/translator\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; + }, + }; + descriptors.set(\\"https://schema.org/translator\\", descriptor); + + descriptor = { + canonicalIri: \\"https://schema.org/translationOfWork\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_Msz9PwRg7cWkiXPL4ixyQLtuuH7) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_Msz9PwRg7cWkiXPL4ixyQLtuuH7; + }, + }; + descriptors.set(\\"https://schema.org/translationOfWork\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/22cd#sourceUpdated\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated; + }, + }; + descriptors.set(\\"https://w3id.org/fep/22cd#sourceUpdated\\", descriptor); + + descriptor = { + canonicalIri: \\"https://schema.org/isBasedOn\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_4KvkQNz1JjGs8S7iJDcGrUYETbUW) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_4KvkQNz1JjGs8S7iJDcGrUYETbUW; + }, + }; + descriptors.set(\\"https://schema.org/isBasedOn\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#url\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + + let element = ( +v instanceof URL ?{ \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#url\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The translated language. Publishers must match a language in the * containing object's content, name, or summary map. @@ -44008,6 +48225,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#translator_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -44020,6 +48238,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -44175,6 +48397,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#translator_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -44187,6 +48410,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -44469,6 +48696,7 @@ get urls(): ((URL | Link))[] { const values: Record = {}; array = []; for (const v of this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG) { + let element = ( { \\"@value\\": v.baseName } ); @@ -44489,8 +48717,29 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -44509,6 +48758,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -44529,6 +48779,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -44552,6 +48803,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -44572,8 +48824,13 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + let element = ( - v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -44652,6 +48909,8 @@ get urls(): ((URL | Link))[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://schema.org/inLanguage\\",\\"https://schema.org/isBasedOn\\",\\"https://schema.org/translationOfWork\\",\\"https://schema.org/translator\\",\\"https://w3id.org/fep/22cd#sourceUpdated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -44841,23 +49100,48 @@ get urls(): ((URL | Link))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -44984,7 +49268,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -45001,6 +49290,16 @@ get urls(): ((URL | Link))[] { } instance.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = _2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Translation.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -45305,6 +49604,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -45404,9 +49707,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -45512,6 +49816,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeatureAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeatureAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeatureAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeatureAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -45878,6 +50256,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -45890,6 +50269,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -46297,6 +50680,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -46309,6 +50693,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -46458,8 +50846,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -46478,8 +50871,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -46564,6 +50962,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -46696,6 +51096,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeatureAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -46727,7 +51130,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -46768,7 +51176,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -46785,6 +51198,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeatureAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -46959,6 +51382,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -47030,9 +51457,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -47207,6 +51635,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -47339,6 +51769,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeatureRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -47346,6 +51779,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeatureRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -47706,6 +52149,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -48017,9 +52464,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -48345,6 +52793,457 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#totalItems\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#totalItems\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#current\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_3UyUdxnyn6cDn53QKrh4MBiearma_current; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#current\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#first\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_J52RqweMe6hhv7RnLJMC8BExTE5_first; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#first\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#last\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#last\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#items\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#likesOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#likesOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#sharesOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#sharesOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#repliesOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#repliesOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#inboxOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#inboxOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#outboxOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#outboxOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#followersOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#followersOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#followingOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#followingOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#likedOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#likedOf\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A non-negative integer specifying the total number of objects contained by * the logical view of the collection. This number might not reflect the actual @@ -48729,6 +53628,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#current_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -48741,6 +53641,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -49150,6 +54054,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#first_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -49162,6 +54067,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -49571,6 +54480,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#last_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -49583,6 +54493,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -50011,6 +54925,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#item_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -50023,6 +54938,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -50432,6 +55351,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#likesOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -50444,6 +55364,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -50852,6 +55776,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#sharesOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -50864,6 +55789,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -51272,6 +56201,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#repliesOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -51284,6 +56214,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -51692,6 +56626,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inboxOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -51704,6 +56639,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -52112,6 +57051,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outboxOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -52124,6 +57064,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -52532,6 +57476,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followersOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -52544,6 +57489,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -52952,6 +57901,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followingOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -52964,6 +57914,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -53372,6 +58326,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#likedOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -53384,6 +58339,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -53753,6 +58712,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -53776,8 +58736,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53796,8 +58761,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53816,8 +58786,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53836,8 +58811,17 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53856,8 +58840,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53876,8 +58865,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53896,8 +58890,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53916,8 +58915,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53936,8 +58940,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53956,8 +58965,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53976,8 +58990,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53996,8 +59015,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -54082,6 +59106,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -54230,6 +59256,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Collection)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -54290,7 +59319,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54331,7 +59365,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54372,7 +59411,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54415,12 +59459,22 @@ const base = getDeepCloneDescriptor(this.prototype)!; && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -54461,7 +59515,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54502,7 +59561,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54543,7 +59607,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54584,7 +59653,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54625,7 +59699,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54666,7 +59745,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54707,7 +59791,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54748,7 +59837,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54765,6 +59859,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Collection.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -55194,6 +60298,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -55304,9 +60412,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -55390,6 +60499,50 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#items\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as OrderedCollection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as OrderedCollection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchItem( url: URL, @@ -55777,6 +60930,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#item_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -55789,6 +60943,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -55920,8 +61078,17 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -56006,6 +61173,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -56142,6 +61311,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof OrderedCollection)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -56175,12 +61347,22 @@ const base = getDeepCloneDescriptor(this.prototype)!; && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -56197,6 +61379,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + OrderedCollection.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -56371,6 +61563,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -56464,9 +61660,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -56550,6 +61747,76 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#topic\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedCollection).#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedCollection).#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#topic\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedCollection).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedCollection).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A single {@link Hashtag} object that represents the main topic or category * of this featured collection. @@ -56685,8 +61952,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -56705,6 +61977,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -56791,6 +62064,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/fep/7aa9#topic\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -56923,6 +62198,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeaturedCollection)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -56945,7 +62223,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Hashtag.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -56991,6 +62274,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = _gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeaturedCollection.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -57187,6 +62480,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -57286,9 +62583,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -57394,6 +62692,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedItem).#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedItem).#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featureAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedItem).#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedItem).#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featureAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchFeaturedObject( url: URL, @@ -57760,6 +63132,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -57772,6 +63145,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -58181,6 +63558,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featureAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -58193,6 +63571,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -58342,8 +63724,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -58362,8 +63749,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -58448,6 +63840,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/7aa9#featureAuthorization\\",\\"https://w3id.org/fep/7aa9#featuredObject\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -58580,6 +63974,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeaturedItem)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -58611,7 +64008,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -58652,7 +64054,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await FeatureAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -58669,6 +64076,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = _2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeaturedItem.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -58773,7 +64190,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; * and verifiable credential repository services. * */ -export class DidService { +export class DidService implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -58789,6 +64206,14 @@ export class DidService { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -58968,6 +64393,10 @@ endpoints?: (URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -59008,6 +64437,7 @@ endpoints?: (URL)[];} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length < vocabSparseArrayMinimumLength ? this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.slice() : vocabCopyPropertyArray(this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint); if (\\"endpoint\\" in values && values.endpoint != null) { @@ -59086,9 +64516,10 @@ endpoints?: (URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -59167,6 +64598,58 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: DidService, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#serviceEndpoint\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DidService).#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DidService).#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#serviceEndpoint\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A network address, such as an HTTP URL, at which services operate on behalf * of a DID subject. @@ -59229,6 +64712,7 @@ get endpoints(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -59304,6 +64788,8 @@ get endpoints(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://www.w3.org/ns/did#serviceEndpoint\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -59472,6 +64958,16 @@ get endpoints(): (URL)[] { } instance.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + DidService.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -59620,6 +65116,10 @@ endpoints?: (URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -59670,9 +65170,10 @@ endpoints?: (URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -59815,6 +65316,8 @@ endpoints?: (URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://www.w3.org/ns/did#serviceEndpoint\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -59947,6 +65450,9 @@ endpoints?: (URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Export)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -59954,6 +65460,16 @@ endpoints?: (URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Export.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -60016,7 +65532,7 @@ endpoints?: (URL)[];} * verify the identity of the actor and the integrity of the data. * */ -export class DataIntegrityProof { +export class DataIntegrityProof implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -60032,6 +65548,14 @@ export class DataIntegrityProof { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -60223,6 +65747,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -60262,6 +65790,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.length < vocabSparseArrayMinimumLength ? this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.slice() : vocabCopyPropertyArray(this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite); if (\\"cryptosuite\\" in values && values.cryptosuite != null) { @@ -60354,9 +65883,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -60456,6 +65986,190 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: DataIntegrityProof, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/security#cryptosuite\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite; + }, + }; + descriptors.set(\\"https://w3id.org/security#cryptosuite\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#verificationMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#verificationMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#proofPurpose\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose) { + + let element = ( +{ + \\"@id\\": \\"https://w3id.org/security#\\" + v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose; + }, + }; + descriptors.set(\\"https://w3id.org/security#proofPurpose\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#proofValue\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue) { + + let element = ( +{ + \\"@type\\": \\"https://w3id.org/security#multibase\\", + \\"@value\\": new TextDecoder().decode(encodeMultibase(\\"base58btc\\", v)), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue; + }, + }; + descriptors.set(\\"https://w3id.org/security#proofValue\\", descriptor); + + descriptor = { + canonicalIri: \\"http://purl.org/dc/terms/created\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_3qzP3ukEZoUziK5FEiA1RhU4aqac) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_3qzP3ukEZoUziK5FEiA1RhU4aqac; + }, + }; + descriptors.set(\\"http://purl.org/dc/terms/created\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The cryptographic suite used to create the proof. * @@ -60944,6 +66658,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite) { + let element = ( { \\"@value\\": v } ); @@ -60964,8 +66679,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -60984,6 +66704,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose) { + let element = ( { \\"@id\\": \\"https://w3id.org/security#\\" + v, @@ -61006,6 +66727,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue) { + let element = ( { \\"@type\\": \\"https://w3id.org/security#multibase\\", @@ -61029,6 +66751,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -61107,6 +66830,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://purl.org/dc/terms/created\\",\\"https://w3id.org/security#cryptosuite\\",\\"https://w3id.org/security#proofPurpose\\",\\"https://w3id.org/security#proofValue\\",\\"https://w3id.org/security#verificationMethod\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -61295,7 +67020,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -61403,6 +67133,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = _3qzP3ukEZoUziK5FEiA1RhU4aqac; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + DataIntegrityProof.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -61578,7 +67318,7 @@ deepCloneDescriptors.set(this.prototype, { }; /** A key owned by an actor. */ -export class CryptographicKey { +export class CryptographicKey implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -61594,6 +67334,14 @@ export class CryptographicKey { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -61744,6 +67492,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -61783,6 +67535,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < vocabSparseArrayMinimumLength ? this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.slice() : vocabCopyPropertyArray(this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner);clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = vocabCopyTrustSet( this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, @@ -61834,9 +67587,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -61914,6 +67668,108 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: CryptographicKey, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/security#owner\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CryptographicKey).#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CryptographicKey).#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner; + }, + }; + descriptors.set(\\"https://w3id.org/security#owner\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKeyPem\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CryptographicKey).#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem) { + + let element = ( +{ \\"@value\\": await exportSpki(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CryptographicKey).#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKeyPem\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchOwner( url: URL, @@ -62340,6 +68196,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#owner_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -62352,6 +68209,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -62510,8 +68371,29 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -62530,6 +68412,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem) { + let element = ( { \\"@value\\": await exportSpki(v) } ); @@ -62605,6 +68488,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#publicKeyPem\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -62765,23 +68650,48 @@ deepCloneDescriptors.set(this.prototype, { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -62827,6 +68737,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = _2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + CryptographicKey.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -62946,7 +68866,7 @@ deepCloneDescriptors.set(this.prototype, { * [1]: https://w3id.org/fep/521a * */ -export class Multikey { +export class Multikey implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -62962,6 +68882,14 @@ export class Multikey { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -63112,6 +69040,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -63151,6 +69083,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < vocabSparseArrayMinimumLength ? this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.slice() : vocabCopyPropertyArray(this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller);clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = vocabCopyTrustSet( this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, @@ -63202,9 +69135,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -63282,6 +69216,111 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Multikey, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/security#controller\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Multikey).#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Multikey).#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller; + }, + }; + descriptors.set(\\"https://w3id.org/security#controller\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKeyMultibase\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Multikey).#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase) { + + let element = ( +{ + \\"@type\\": \\"https://w3id.org/security#multibase\\", + \\"@value\\": await exportMultibaseKey(v), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Multikey).#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKeyMultibase\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchController( url: URL, @@ -63708,6 +69747,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#controller_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -63720,6 +69760,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -63882,8 +69926,29 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -63902,6 +69967,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase) { + let element = ( { \\"@type\\": \\"https://w3id.org/security#multibase\\", @@ -63980,6 +70046,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#publicKeyMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -64140,23 +70208,48 @@ deepCloneDescriptors.set(this.prototype, { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -64202,6 +70295,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase = _4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Multikey.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -64418,6 +70521,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -64511,9 +70618,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -64619,6 +70727,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#stipulates\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Agreement).#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Agreement).#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#stipulates\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#stipulatesReciprocal\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Agreement).#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Agreement).#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#stipulatesReciprocal\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The primary {@link Commitment} associated with the agreement. This * commitment satisfies the primary {@link Intent} of the corresponding @@ -64759,8 +70941,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -64779,8 +70966,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -64865,6 +71057,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/valueflows/ont/vf#stipulates\\",\\"https://w3id.org/valueflows/ont/vf#stipulatesReciprocal\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -64997,6 +71191,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Agreement)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -65019,7 +71216,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Commitment.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -65051,7 +71253,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Commitment.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -65068,6 +71275,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal = _4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Agreement.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -65172,7 +71389,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; * specifies the actual amount of the economic resource being committed. * */ -export class Commitment { +export class Commitment implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -65188,6 +71405,14 @@ export class Commitment { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -65333,6 +71558,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -65372,6 +71601,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies = this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length < vocabSparseArrayMinimumLength ? this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.slice() : vocabCopyPropertyArray(this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies); if (\\"satisfies\\" in values && values.satisfies != null) { @@ -65417,9 +71647,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -65519,6 +71750,92 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Commitment, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#satisfies\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Commitment).#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Commitment).#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#satisfies\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Commitment).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Commitment).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The {@link Intent} of a {@link Proposal} that this commitment * satisfies. The value is the proposal's URI with a @@ -65641,6 +71958,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -65661,8 +71979,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -65736,6 +72059,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -65915,7 +72240,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -65932,6 +72262,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Commitment.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -66049,7 +72389,7 @@ deepCloneDescriptors.set(this.prototype, { * in a {@link Proposal}. * */ -export class Intent { +export class Intent implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -66065,6 +72405,14 @@ export class Intent { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -66252,6 +72600,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -66291,6 +72643,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length < vocabSparseArrayMinimumLength ? this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.slice() : vocabCopyPropertyArray(this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action); if (\\"action\\" in values && values.action != null) { @@ -66378,9 +72731,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -66524,6 +72878,190 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Intent, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#action\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#action\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#availableQuantity\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#availableQuantity\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The type of economic transaction. The value of this property should be * either \`\\"deliverService\\"\` or \`\\"transfer\\"\`. @@ -66739,6 +73277,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) { + let element = ( { \\"@value\\": v } ); @@ -66759,6 +73298,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -66779,8 +73319,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -66799,8 +73344,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -66819,8 +73369,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -66894,6 +73449,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://w3id.org/valueflows/ont/vf#action\\",\\"https://w3id.org/valueflows/ont/vf#availableQuantity\\",\\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -67103,7 +73660,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -67135,7 +73697,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -67167,7 +73734,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -67184,6 +73756,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Intent.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -67488,6 +74070,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -67609,9 +74195,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -67717,6 +74304,140 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#purpose\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#purpose\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#publishes\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#publishes\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#reciprocal\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#reciprocal\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#unitBased\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#unitBased\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The type of proposal. Possible values are \`\\"offer\\"\` and \`\\"request\\"\`. * @@ -67916,6 +74637,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) { + let element = ( { \\"@value\\": v } ); @@ -67936,8 +74658,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -67956,8 +74683,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -67976,6 +74708,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) { + let element = ( { \\"@value\\": v } ); @@ -68062,6 +74795,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/valueflows/ont/vf#publishes\\",\\"https://w3id.org/valueflows/ont/vf#purpose\\",\\"https://w3id.org/valueflows/ont/vf#reciprocal\\",\\"https://w3id.org/valueflows/ont/vf#unitBased\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -68194,6 +74929,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Proposal)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -68246,7 +74984,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -68278,7 +75021,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -68324,6 +75072,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Proposal.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -68534,6 +75292,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -68605,9 +75367,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -68782,6 +75545,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -68918,6 +75683,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Accept)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -68925,6 +75693,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Accept.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -69056,6 +75834,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -69127,9 +75909,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -69304,6 +76087,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -69436,6 +76221,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Add)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -69443,6 +76231,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Add.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -69573,6 +76371,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -69644,9 +76446,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -69821,6 +76624,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -69953,6 +76758,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Announce)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -69960,6 +76768,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Announce.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -70823,6 +77641,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -71648,9 +78470,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -72092,6 +78915,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -72481,6 +80163,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -72493,6 +80176,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -72642,6 +80329,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -72654,6 +80342,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -73066,6 +80758,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -73078,6 +80771,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -73231,6 +80928,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -73243,6 +80941,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -73725,6 +81427,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -73737,6 +81440,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -74169,6 +81876,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -74181,6 +81889,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -74593,6 +82305,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -74605,6 +82318,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -75020,6 +82737,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -75032,6 +82750,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -75445,6 +83167,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -75457,6 +83180,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -75868,6 +83595,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -75880,6 +83608,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -76291,6 +84023,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -76303,6 +84036,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -76711,6 +84448,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -76723,6 +84461,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -77135,6 +84877,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -77147,6 +84890,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -77701,6 +85448,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -77713,6 +85461,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -78184,6 +85936,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -78196,6 +85949,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -78349,6 +86106,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -78361,6 +86119,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -78773,6 +86535,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -78785,6 +86548,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -78938,6 +86705,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -78950,6 +86718,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -79626,6 +87398,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -79649,8 +87422,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79669,8 +87447,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79689,6 +87472,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -79709,6 +87493,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -79729,8 +87514,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79749,8 +87543,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79769,8 +87572,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79789,8 +87597,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79809,8 +87622,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79829,8 +87647,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79849,8 +87672,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79869,8 +87697,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79889,8 +87722,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79909,8 +87747,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79929,6 +87772,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -79949,6 +87793,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -79969,6 +87814,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -79989,6 +87835,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -80029,8 +87876,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -80049,8 +87917,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -80069,8 +87958,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -80089,6 +87983,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -80109,6 +88004,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -80129,6 +88025,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -80230,6 +88127,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -80362,6 +88261,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Application)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -80426,7 +88328,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80467,7 +88374,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80568,11 +88480,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -80615,11 +88537,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -80660,7 +88592,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80701,7 +88638,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80742,7 +88684,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80783,7 +88730,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80824,7 +88776,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80865,7 +88822,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80906,7 +88868,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80938,7 +88905,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -81126,23 +89098,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -81184,23 +89181,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -81241,7 +89263,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -81346,6 +89373,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Application.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -82036,6 +90073,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -82107,9 +90148,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -82284,6 +90326,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -82428,6 +90472,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof IntransitiveActivity)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -82435,6 +90482,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + IntransitiveActivity.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -82565,6 +90622,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -82636,9 +90697,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -82813,6 +90875,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -82945,6 +91009,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Arrive)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -82952,6 +91019,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Arrive.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -83119,6 +91196,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -83232,9 +91313,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -83362,6 +91444,112 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Article).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Article).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#quoteUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Article).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ \\"@value\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Article).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); +descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); +descriptors.set(\\"http://fedibird.com/ns#quoteUri\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quoteAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Article).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Article).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchQuote( url: URL, @@ -83731,6 +91919,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -83743,6 +91932,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84175,6 +92368,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -84187,6 +92381,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84362,8 +92560,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -84382,6 +92585,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { \\"@value\\": formatIri(v) } ); @@ -84406,8 +92610,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -84492,6 +92701,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -84624,6 +92835,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Article)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -84655,7 +92869,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -84735,7 +92954,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -84752,6 +92976,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Article.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -84975,6 +93209,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -85082,9 +93320,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -85138,6 +93377,108 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; return deepCloneGraph(this, this.clone(values, cloneOptions)); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#width\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Document).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Document).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#width\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#height\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Document).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Document).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#height\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Document).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Document).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** Specifies a hint as to the rendering width in * device-independent pixels of the linked resource. @@ -85301,6 +93642,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -85324,6 +93666,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -85347,6 +93690,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + let element = ( { \\"@value\\": v } ); @@ -85433,6 +93777,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -85581,6 +93927,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Document)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -85676,6 +94025,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } instance.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Document.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -85857,6 +94216,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -85922,9 +94285,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -86112,6 +94476,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -86244,6 +94610,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Audio)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -86251,6 +94620,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Audio.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -86380,6 +94759,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -86451,9 +94834,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -86628,6 +95012,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -86764,6 +95150,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Ignore)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -86771,6 +95160,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Ignore.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -86902,6 +95301,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -86973,9 +95376,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -87150,6 +95554,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -87282,6 +95688,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Block)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -87289,6 +95698,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Block.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -87461,6 +95880,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -87577,9 +96000,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -87707,6 +96131,114 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#partOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CollectionPage).#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CollectionPage).#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#partOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#next\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CollectionPage).#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CollectionPage).#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#next\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#prev\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CollectionPage).#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CollectionPage).#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#prev\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchPartOf( url: URL, @@ -88075,6 +96607,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#partOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -88087,6 +96620,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -88494,6 +97031,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#next_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -88506,6 +97044,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -88914,6 +97456,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#prev_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -88926,6 +97469,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -89095,8 +97642,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -89115,8 +97667,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -89135,8 +97692,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -89221,6 +97783,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -89357,6 +97921,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof CollectionPage)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -89388,7 +97955,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -89429,7 +98001,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -89470,7 +98047,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -89487,6 +98069,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + CollectionPage.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -89674,6 +98266,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -89745,9 +98341,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -89922,6 +98519,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -90054,6 +98653,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Create)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -90061,6 +98663,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Create.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -90190,6 +98802,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -90261,9 +98877,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -90438,6 +99055,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -90570,6 +99189,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Delete)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -90577,6 +99199,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Delete.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -90704,6 +99336,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -90775,9 +99411,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -90952,6 +99589,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -91084,6 +99723,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Dislike)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -91091,6 +99733,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Dislike.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -91151,7 +99803,7 @@ instruments?: (Object | URL)[];} }; /** Contents of {@link Actor}'s \`endpoints\`. */ -export class Endpoints { +export class Endpoints implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -91167,6 +99819,14 @@ export class Endpoints { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -91382,6 +100042,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -91421,6 +100085,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length < vocabSparseArrayMinimumLength ? this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.slice() : vocabCopyPropertyArray(this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl); if (\\"proxyUrl\\" in values && values.proxyUrl != null) { @@ -91536,9 +100201,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -91748,6 +100414,238 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Endpoints, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#proxyUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#proxyUrl\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#provideClientKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#provideClientKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#signClientKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#signClientKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#sharedInbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#sharedInbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#uploadMedia\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#uploadMedia\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** Endpoint URI so this actor's clients may access remote ActivityStreams * objects which require authentication to access. To use this endpoint, @@ -92038,6 +100936,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92058,6 +100957,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92078,6 +100978,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92098,6 +100999,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92118,6 +101020,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92138,6 +101041,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92158,6 +101062,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92233,6 +101138,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#uploadMedia\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -92571,6 +101478,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia = _KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Endpoints.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -92847,6 +101764,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -92912,9 +101833,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -93102,6 +102024,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -93234,6 +102158,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Event)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -93241,6 +102168,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Event.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -93371,6 +102308,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -93442,9 +102383,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -93619,6 +102561,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -93751,6 +102695,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Flag)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -93758,6 +102705,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Flag.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -93889,6 +102846,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -93960,9 +102921,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -94137,6 +103099,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -94269,6 +103233,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Follow)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -94276,6 +103243,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Follow.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -95139,6 +104116,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -95964,9 +104945,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -96408,6 +105390,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -96797,6 +106638,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -96809,6 +106651,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -96958,6 +106804,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -96970,6 +106817,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -97382,6 +107233,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -97394,6 +107246,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -97547,6 +107403,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -97559,6 +107416,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -98041,6 +107902,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -98053,6 +107915,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -98485,6 +108351,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -98497,6 +108364,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -98909,6 +108780,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -98921,6 +108793,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -99336,6 +109212,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -99348,6 +109225,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -99761,6 +109642,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -99773,6 +109655,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -100184,6 +110070,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -100196,6 +110083,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -100607,6 +110498,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -100619,6 +110511,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -101027,6 +110923,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -101039,6 +110936,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -101451,6 +111352,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -101463,6 +111365,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -102017,6 +111923,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -102029,6 +111936,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -102500,6 +112411,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -102512,6 +112424,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -102665,6 +112581,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -102677,6 +112594,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -103089,6 +113010,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -103101,6 +113023,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -103254,6 +113180,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -103266,6 +113193,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -103942,6 +113873,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -103965,8 +113897,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -103985,8 +113922,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104005,6 +113947,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -104025,6 +113968,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -104045,8 +113989,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104065,8 +114018,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104085,8 +114047,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104105,8 +114072,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104125,8 +114097,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104145,8 +114122,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104165,8 +114147,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104185,8 +114172,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104205,8 +114197,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104225,8 +114222,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104245,6 +114247,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -104265,6 +114268,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -104285,6 +114289,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -104305,6 +114310,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -104345,8 +114351,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104365,8 +114392,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104385,8 +114433,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104405,6 +114458,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -104425,6 +114479,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -104445,6 +114500,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -104546,6 +114602,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -104678,6 +114736,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Group)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -104742,7 +114803,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -104783,7 +114849,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -104884,11 +114955,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -104931,11 +115012,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -104976,7 +115067,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105017,7 +115113,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105058,7 +115159,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105099,7 +115205,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105140,7 +115251,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105181,7 +115297,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105222,7 +115343,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105254,7 +115380,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105442,23 +115573,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -105500,23 +115656,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -105557,7 +115738,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105662,6 +115848,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Group.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -106290,7 +116486,7 @@ get attributionDomains(): (string)[] { * the resource. * */ -export class Link { +export class Link implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -106306,6 +116502,14 @@ export class Link { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -106715,6 +116919,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -106756,6 +116964,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length < vocabSparseArrayMinimumLength ? this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.slice() : vocabCopyPropertyArray(this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href); if (\\"href\\" in values && values.href != null) { @@ -107064,9 +117273,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -107190,6 +117400,347 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Link, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#href\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#href\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#rel\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#rel\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#mediaType\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#name\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#hreflang\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang) { + + let element = ( +{ \\"@value\\": v.baseName } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#hreflang\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#height\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#height\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#width\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#width\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preview\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Link ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preview\\", descriptor); + + descriptor = { + canonicalIri: \\"http://purl.org/dc/terms/license\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + }, + }; + descriptors.set(\\"http://purl.org/dc/terms/license\\", descriptor); +descriptors.set(\\"https://schema.org/license\\", descriptor); +descriptors.set(\\"http://creativecommons.org/ns#license\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The target resource pointed to by a {@link Link}. */ @@ -107720,6 +118271,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#preview_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -107732,6 +118284,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -108015,6 +118571,7 @@ get licenses(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -108035,6 +118592,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel) { + let element = ( { \\"@value\\": v } ); @@ -108055,6 +118613,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + let element = ( { \\"@value\\": v } ); @@ -108075,6 +118634,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + let element = ( { \\"@value\\": v } ); @@ -108095,6 +118655,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -108118,6 +118679,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang) { + let element = ( { \\"@value\\": v.baseName } ); @@ -108138,6 +118700,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -108161,6 +118724,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -108184,8 +118748,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -108204,6 +118777,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -108289,6 +118863,8 @@ get licenses(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://purl.org/dc/terms/license\\",\\"https://schema.org/license\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#hreflang\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#rel\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -108697,12 +119273,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -108756,6 +119342,16 @@ get licenses(): (URL)[] { } instance.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = _2rzkBRS4gNPrkJk9DohHAMUAxA2d; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Link.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -109097,6 +119693,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -109148,9 +119748,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -109313,6 +119914,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://purl.org/dc/terms/license\\",\\"https://schema.org/license\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#hreflang\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#rel\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -109445,6 +120048,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Hashtag)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -109452,6 +120058,16 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Hashtag.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -109573,6 +120189,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -109638,9 +120258,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -109828,6 +120449,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -109960,6 +120583,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Image)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -109967,6 +120593,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Image.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -110097,6 +120733,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -110168,9 +120808,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -110345,6 +120986,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -110481,6 +121124,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Offer)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -110488,6 +121134,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Offer.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -110617,6 +121273,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -110688,9 +121348,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -110865,6 +121526,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -110997,6 +121660,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Invite)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -111004,6 +121670,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Invite.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -111133,6 +121809,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -111204,9 +121884,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -111381,6 +122062,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -111513,6 +122196,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Join)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -111520,6 +122206,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Join.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -111649,6 +122345,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -111720,9 +122420,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -111897,6 +122598,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -112029,6 +122732,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Leave)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -112036,6 +122742,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Leave.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -112165,6 +122881,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -112236,9 +122956,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -112413,6 +123134,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -112545,6 +123268,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Like)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -112552,6 +123278,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Like.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -112679,6 +123415,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -112750,9 +123490,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -112927,6 +123668,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -113059,6 +123802,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Listen)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -113066,6 +123812,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Listen.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -113173,6 +123929,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -113224,9 +123984,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -113389,6 +124150,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://purl.org/dc/terms/license\\",\\"https://schema.org/license\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#hreflang\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#rel\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -113521,6 +124284,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Mention)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -113528,6 +124294,16 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Mention.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -113658,6 +124434,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -113729,9 +124509,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -113906,6 +124687,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -114038,6 +124821,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Move)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -114045,6 +124831,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Move.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -114214,6 +125010,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -114327,9 +125127,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -114457,6 +125258,112 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Note).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Note).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#quoteUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Note).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ \\"@value\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Note).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); +descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); +descriptors.set(\\"http://fedibird.com/ns#quoteUri\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quoteAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Note).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Note).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchQuote( url: URL, @@ -114826,6 +125733,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -114838,6 +125746,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -115270,6 +126182,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -115282,6 +126195,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -115457,8 +126374,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -115477,6 +126399,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { \\"@value\\": formatIri(v) } ); @@ -115501,8 +126424,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -115587,6 +126515,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -115719,6 +126649,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Note)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -115750,7 +126683,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -115830,7 +126768,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -115847,6 +126790,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Note.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -116089,6 +127042,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -116213,9 +127170,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -116299,6 +127257,83 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#items\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as OrderedCollectionPage).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as OrderedCollectionPage).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#startIndex\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as OrderedCollectionPage).#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as OrderedCollectionPage).#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#startIndex\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchItem( url: URL, @@ -116686,6 +127721,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#item_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -116698,6 +127734,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -116860,8 +127900,17 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -116880,6 +127929,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -116969,6 +128019,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startIndex\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -117101,6 +128153,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof OrderedCollectionPage)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -117134,12 +128189,22 @@ const base = getDeepCloneDescriptor(this.prototype)!; && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -117185,6 +128250,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex = _2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + OrderedCollectionPage.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -118090,6 +129165,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -118915,9 +129994,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -119359,6 +130439,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -119748,6 +131687,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -119760,6 +131700,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -119909,6 +131853,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -119921,6 +131866,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -120333,6 +132282,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -120345,6 +132295,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -120498,6 +132452,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -120510,6 +132465,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -120992,6 +132951,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -121004,6 +132964,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -121436,6 +133400,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -121448,6 +133413,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -121860,6 +133829,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -121872,6 +133842,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -122287,6 +134261,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -122299,6 +134274,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -122712,6 +134691,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -122724,6 +134704,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -123135,6 +135119,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -123147,6 +135132,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -123558,6 +135547,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -123570,6 +135560,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -123978,6 +135972,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -123990,6 +135985,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -124402,6 +136401,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -124414,6 +136414,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -124968,6 +136972,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -124980,6 +136985,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -125451,6 +137460,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -125463,6 +137473,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -125616,6 +137630,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -125628,6 +137643,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -126040,6 +138059,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -126052,6 +138072,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -126205,6 +138229,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -126217,6 +138242,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -126893,6 +138922,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -126916,8 +138946,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -126936,8 +138971,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -126956,6 +138996,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -126976,6 +139017,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -126996,8 +139038,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127016,8 +139067,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127036,8 +139096,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127056,8 +139121,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127076,8 +139146,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127096,8 +139171,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127116,8 +139196,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127136,8 +139221,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127156,8 +139246,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127176,8 +139271,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127196,6 +139296,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -127216,6 +139317,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -127236,6 +139338,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -127256,6 +139359,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -127296,8 +139400,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127316,8 +139441,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127336,8 +139482,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127356,6 +139507,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -127376,6 +139528,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -127396,6 +139549,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -127497,6 +139651,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -127629,6 +139785,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Organization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -127693,7 +139852,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -127734,7 +139898,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -127835,11 +140004,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -127882,11 +140061,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -127927,7 +140116,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -127968,7 +140162,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128009,7 +140208,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128050,7 +140254,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128091,7 +140300,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128132,7 +140346,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128173,7 +140392,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128205,7 +140429,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128393,23 +140622,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -128451,23 +140705,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -128508,7 +140787,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128613,6 +140897,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Organization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -129294,6 +141588,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -129359,9 +141657,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -129549,6 +141848,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -129681,6 +141982,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Page)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -129688,6 +141992,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Page.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -130551,6 +142865,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -131376,9 +143694,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -131820,6 +144139,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -132209,6 +145387,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -132221,6 +145400,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132370,6 +145553,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -132382,6 +145566,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132794,6 +145982,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -132806,6 +145995,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132959,6 +146152,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -132971,6 +146165,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133453,6 +146651,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -133465,6 +146664,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133897,6 +147100,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -133909,6 +147113,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -134321,6 +147529,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -134333,6 +147542,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -134748,6 +147961,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -134760,6 +147974,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -135173,6 +148391,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -135185,6 +148404,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -135596,6 +148819,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -135608,6 +148832,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136019,6 +149247,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -136031,6 +149260,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136439,6 +149672,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -136451,6 +149685,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136863,6 +150101,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -136875,6 +150114,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137429,6 +150672,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -137441,6 +150685,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137912,6 +151160,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -137924,6 +151173,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138077,6 +151330,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -138089,6 +151343,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138501,6 +151759,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -138513,6 +151772,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138666,6 +151929,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -138678,6 +151942,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -139354,6 +152622,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -139377,8 +152646,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139397,8 +152671,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139417,6 +152696,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -139437,6 +152717,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -139457,8 +152738,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139477,8 +152767,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139497,8 +152796,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139517,8 +152821,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139537,8 +152846,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139557,8 +152871,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139577,8 +152896,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139597,8 +152921,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139617,8 +152946,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139637,8 +152971,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139657,6 +152996,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -139677,6 +153017,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -139697,6 +153038,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -139717,6 +153059,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -139757,8 +153100,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139777,8 +153141,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139797,8 +153182,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139817,6 +153207,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -139837,6 +153228,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -139857,6 +153249,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -139958,6 +153351,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -140090,6 +153485,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Person)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -140154,7 +153552,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140195,7 +153598,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140296,11 +153704,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140343,11 +153761,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140388,7 +153816,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140429,7 +153862,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140470,7 +153908,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140511,7 +153954,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140552,7 +154000,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140593,7 +154046,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140634,7 +154092,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140666,7 +154129,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140854,23 +154322,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140912,23 +154405,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140969,7 +154487,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -141074,6 +154597,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Person.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -141842,6 +155375,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -141991,9 +155528,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -142077,6 +155615,207 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#accuracy\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#accuracy\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#altitude\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#altitude\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#latitude\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#latitude\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#longitude\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#longitude\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#radius\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#radius\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#units\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { + + let element = ( +v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ?{ \\"@value\\": v } :{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#units\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** Indicates the accuracy of position coordinates on a {@link Place} objects. * Expressed in properties of percentage. e.g. \\"94.0\\" means \\"94.0% accurate\\". @@ -142331,6 +156070,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142354,6 +156094,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142377,6 +156118,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142400,6 +156142,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142423,6 +156166,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142446,6 +156190,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { + let element = ( v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? { \\"@value\\": v } : { \\"@id\\": formatIri(v) } ); @@ -142532,6 +156277,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#accuracy\\",\\"https://www.w3.org/ns/activitystreams#altitude\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#latitude\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#longitude\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#radius\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -142664,6 +156411,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Place)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -142848,6 +156598,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units = _oKrwxU4V8wiKhMW1QEYQibcJh8c_units; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Place.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -143110,6 +156870,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -143192,9 +156956,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -143278,6 +157043,46 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#describes\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Profile).#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Profile).#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#describes\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchDescribes( url: URL, @@ -143646,6 +157451,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#describes_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -143658,6 +157464,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -143787,8 +157597,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -143873,6 +157688,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -144005,6 +157822,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Profile)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -144036,7 +157856,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -144053,6 +157878,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Profile.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -144370,6 +158205,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -144607,9 +158446,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -144787,6 +158627,246 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#oneOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#oneOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#anyOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#anyOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#closed\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed) { + + let element = ( +isTemporalInstant(v) ?{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } :{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#closed\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#votersCount\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#votersCount\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#quoteUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ \\"@value\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); +descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); +descriptors.set(\\"http://fedibird.com/ns#quoteUri\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quoteAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchExclusiveOption( url: URL, @@ -145160,6 +159240,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#exclusiveOption_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -145172,6 +159253,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -145587,6 +159672,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#inclusiveOption_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -145599,6 +159685,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146040,6 +160130,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -146052,6 +160143,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146484,6 +160579,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -146496,6 +160592,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146586,8 +160686,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146606,8 +160711,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146626,6 +160736,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed) { + let element = ( isTemporalInstant(v) ? { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -146649,6 +160760,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -146672,8 +160784,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146692,6 +160809,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { \\"@value\\": formatIri(v) } ); @@ -146716,8 +160834,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146802,6 +160925,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#votersCount\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#closed\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -146934,6 +161059,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Question)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -146965,7 +161093,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147006,7 +161139,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147115,7 +161253,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147195,7 +161338,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147212,6 +161360,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Question.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -147484,6 +161642,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -147555,9 +161717,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -147732,6 +161895,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -147864,6 +162029,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Read)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -147871,6 +162039,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Read.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -148000,6 +162178,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -148071,9 +162253,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -148248,6 +162431,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -148384,6 +162569,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Reject)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -148391,6 +162579,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Reject.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -148667,6 +162865,10 @@ relationships?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -148885,9 +163087,10 @@ relationships?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -149017,6 +163220,114 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#subject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Relationship).#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Relationship).#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#subject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#object\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Relationship).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Relationship).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#object\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#relationship\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Relationship).#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Relationship).#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#relationship\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchSubject( url: URL, @@ -149387,6 +163698,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#subject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -149399,6 +163711,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -149807,6 +164123,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#object_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -149819,6 +164136,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -149969,6 +164290,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#object_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -149981,6 +164303,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150392,6 +164718,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#relationship_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -150404,6 +164731,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150556,6 +164887,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#relationship_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -150568,6 +164900,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150738,8 +165074,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -150758,8 +165099,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -150778,8 +165124,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -150864,6 +165215,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -150996,6 +165349,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Relationship)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -151027,7 +165383,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -151068,7 +165429,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -151109,7 +165475,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -151126,6 +165497,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Relationship.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -151327,6 +165708,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -151398,9 +165783,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -151575,6 +165961,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -151707,6 +166095,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Remove)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -151714,6 +166105,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Remove.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -152577,6 +166978,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -153402,9 +167807,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -153846,6 +168252,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -154235,6 +169500,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -154247,6 +169513,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -154396,6 +169666,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -154408,6 +169679,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -154820,6 +170095,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -154832,6 +170108,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -154985,6 +170265,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -154997,6 +170278,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -155479,6 +170764,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -155491,6 +170777,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -155923,6 +171213,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -155935,6 +171226,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -156347,6 +171642,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -156359,6 +171655,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -156774,6 +172074,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -156786,6 +172087,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -157199,6 +172504,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -157211,6 +172517,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -157622,6 +172932,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -157634,6 +172945,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -158045,6 +173360,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -158057,6 +173373,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -158465,6 +173785,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -158477,6 +173798,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -158889,6 +174214,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -158901,6 +174227,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -159455,6 +174785,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -159467,6 +174798,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -159938,6 +175273,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -159950,6 +175286,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160103,6 +175443,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -160115,6 +175456,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160527,6 +175872,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -160539,6 +175885,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160692,6 +176042,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -160704,6 +176055,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -161380,6 +176735,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -161403,8 +176759,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161423,8 +176784,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161443,6 +176809,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -161463,6 +176830,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -161483,8 +176851,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161503,8 +176880,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161523,8 +176909,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161543,8 +176934,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161563,8 +176959,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161583,8 +176984,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161603,8 +177009,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161623,8 +177034,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161643,8 +177059,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161663,8 +177084,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161683,6 +177109,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -161703,6 +177130,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -161723,6 +177151,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -161743,6 +177172,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -161783,8 +177213,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161803,8 +177254,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161823,8 +177295,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161843,6 +177320,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -161863,6 +177341,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -161883,6 +177362,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -161984,6 +177464,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -162116,6 +177598,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Service)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -162180,7 +177665,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162221,7 +177711,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162322,11 +177817,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162369,11 +177874,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162414,7 +177929,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162455,7 +177975,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162496,7 +178021,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162537,7 +178067,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162578,7 +178113,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162619,7 +178159,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162660,7 +178205,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162692,7 +178242,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162880,23 +178435,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162938,23 +178518,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162995,7 +178600,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -163100,6 +178710,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Service.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -163720,7 +179340,7 @@ get attributionDomains(): (string)[] { }; /** Contents of {@link Object}'s \`source\`. */ -export class Source { +export class Source implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -163736,6 +179356,14 @@ export class Source { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -163929,6 +179557,10 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -163969,6 +179601,7 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.length < vocabSparseArrayMinimumLength ? this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice() : vocabCopyPropertyArray(this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content); if (\\"content\\" in values && values.content != null) { @@ -164061,9 +179694,10 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -164120,6 +179754,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Source, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#content\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Source).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Source).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#content\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#mediaType\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Source).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Source).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The source content. */ @@ -164239,6 +179958,7 @@ get contents(): ((string | LanguageString))[] { const values: Record = {}; array = []; for (const v of this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -164262,6 +179982,7 @@ get contents(): ((string | LanguageString))[] { array = []; for (const v of this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + let element = ( { \\"@value\\": v } ); @@ -164342,6 +180063,8 @@ get contents(): ((string | LanguageString))[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -164540,6 +180263,16 @@ get contents(): ((string | LanguageString))[] { } instance.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Source.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -164730,6 +180463,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -164801,9 +180538,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -164978,6 +180716,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -165110,6 +180850,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof TentativeAccept)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -165117,6 +180860,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + TentativeAccept.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -165246,6 +180999,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -165317,9 +181074,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -165494,6 +181252,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -165626,6 +181386,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof TentativeReject)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -165633,6 +181396,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + TentativeReject.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -165833,6 +181606,10 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -165974,9 +181751,10 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -166031,6 +181809,75 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} }; return deepCloneGraph(this, this.clone(values, cloneOptions)); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#formerType\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Tombstone).#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { + + let element = ( +{ \\"@id\\": v.typeId.href } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Tombstone).#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#formerType\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#deleted\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Tombstone).#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Tombstone).#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#deleted\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** On a \`Tombstone\` object, the \`formerType\` property identifies the type of * the object that was deleted. @@ -166103,57 +181950,766 @@ get formerTypes(): (\$EntityType)[] { // child documents back in place of their placeholders. const signedValues = enterSignedValueScope(options); - if (options.format == null && this.isCompactable()) { - - const result = await super.toJsonLd({ - ...options, - format: undefined, - context: undefined, - }) as Record; - - // deno-lint-ignore no-unused-vars - let compactItems: unknown[]; - - compactItems = []; - for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { - const item = ( - { \\"@id\\": v.typeId.href } - ); - compactItems.push(item); - } - if (compactItems.length > 0) { - - result[\\"formerType\\"] - = compactItems.length > 1 - ? compactItems - : compactItems[0]; - - } - - compactItems = []; - for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { - const item = ( - v.toString() - ); - compactItems.push(item); - } - if (compactItems.length > 0) { - - result[\\"deleted\\"] - = compactItems.length > 1 - ? compactItems - : compactItems[0]; - - } - - result[\\"type\\"] = \\"Tombstone\\"; - if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; - return signedValues.owner - ? resolveSignedValues(result, signedValues.scope) - : result; - } - + if (options.format == null && this.isCompactable()) { + + const result = await super.toJsonLd({ + ...options, + format: undefined, + context: undefined, + }) as Record; + + // deno-lint-ignore no-unused-vars + let compactItems: unknown[]; + + compactItems = []; + for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { + const item = ( + { \\"@id\\": v.typeId.href } + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"formerType\\"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + + compactItems = []; + for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { + const item = ( + v.toString() + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"deleted\\"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + + result[\\"type\\"] = \\"Tombstone\\"; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + return signedValues.owner + ? resolveSignedValues(result, signedValues.scope) + : result; + } + + // deno-lint-ignore no-unused-vars prefer-const + let array: unknown[]; + + const baseValues = await super.toJsonLd({ + ...options, + format: \\"expand\\", + context: undefined, + }) as unknown[]; + const values = baseValues[0] as Record< + string, + unknown[] | { \\"@list\\": unknown[] } | string + >; + + array = []; + for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { + + let element = ( + { \\"@id\\": v.typeId.href } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values[\\"https://www.w3.org/ns/activitystreams#formerType\\"] = propValue; + + } + + array = []; + for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { + + let element = ( + { + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values[\\"https://www.w3.org/ns/activitystreams#deleted\\"] = propValue; + + } + + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Tombstone\\"]; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); + if (options.format === \\"expand\\") { + return await jsonld.expand( + values, + { + documentLoader: options.contextLoader, + keepFreeFloatingNodes: true, + }, + ); + } + let docContext: Parameters[1] = options.context ?? + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + + if (options.context == null) { + const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; + const additionalContexts = getExtraContexts(values).filter( + context => !currentContexts.includes(context) + ); + if (additionalContexts.length > 0) { + docContext = [...currentContexts, ...additionalContexts]; + } + } + + let compacted = await jsonld.compact( + values, + docContext, + { documentLoader: options.contextLoader }, + ); + + if (options.context == null) { + const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; + const additionalContexts = getExtraContexts(compacted).filter( + context => !currentContexts.includes(context) + ); + if (additionalContexts.length > 0) { + docContext = [...currentContexts, ...additionalContexts]; + compacted = await jsonld.compact(values, docContext, { + documentLoader: options.contextLoader, + }); + } + } + + if (docContext != null) { + // Embed context + + if (\\"proof\\" in compacted && + compacted.proof != null) { + if (Array.isArray(compacted.proof)) { + for (const element of compacted.proof) { + element[\\"@context\\"] = docContext; + } + } else { + compacted.proof[\\"@context\\"] = docContext; + } + } + + } + return signedValues.owner + ? resolveSignedValues(compacted, signedValues.scope) + : compacted; + } + + protected override isCompactable(): boolean { + + if ( + this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType != null && + this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0 + ) return false; + + return super.isCompactable(); + } + + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#deleted\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#formerType\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + + /** + * Converts a JSON-LD structure to an object of this type. + * @param json The JSON-LD structure to convert. + * @param options The options to use. + * - \`documentLoader\`: The loader for remote JSON-LD documents. + * - \`contextLoader\`: The loader for remote JSON-LD contexts. + * - \`tracerProvider\`: The OpenTelemetry tracer provider to use. + * If omitted, the global tracer provider is used. + * - \`verifyPortableObject\`: The default FEP-ef61 portable + * object verifier for the property accessors of the + * returned object and the objects obtained from it. It + * does not verify the given \`json\` itself. + * @returns The object of this type. + * @throws {TypeError} If the given \`json\` is invalid. + */ + static override async fromJsonLd( + json: unknown, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + baseUrl?: URL, + } = {}, + ): Promise { + const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); + const tracer = tracerProvider.getTracer( + \\"@fedify/vocab-tools\\", + \\"0.0.0\\", + ); + return await tracer.startActiveSpan( + \\"activitypub.parse_object\\", + async (span) => { + try { + const object = await this.__fromJsonLd__Tombstone__( + json, span, options); + if (object.id != null) { + span.setAttribute(\\"activitypub.object.id\\", object.id.href); + } + return object; + } catch (error) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: String(error), + }); + throw error; + } finally { + span.end(); + } + }, + ); + } + + protected static async __fromJsonLd__Tombstone__( + json: unknown, + span: Span, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + baseUrl?: URL, + } = {}, + ): Promise { + if (typeof json === \\"undefined\\") { + throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); + } + else if (json === null) throw new TypeError(\\"Invalid JSON-LD: null.\\"); + options = { + ...options, + documentLoader: options.documentLoader ?? getDocumentLoader(), + contextLoader: options.contextLoader ?? getDocumentLoader(), + tracerProvider: options.tracerProvider ?? trace.getTracerProvider(), + }; + // deno-lint-ignore no-explicit-any + let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; + if ( + \\"_fromSubclass\\" in options && + options._fromSubclass && + typeof json === \\"object\\" && + !Array.isArray(json) + ) { + values = + // deno-lint-ignore no-explicit-any + json as (Record & { \\"@id\\"?: string }); + expanded = [values]; + } else if (globalThis.Object.keys(json).length == 0) { + values = {}; + expanded = [values]; + } else { + expanded = await jsonld.expand(json, { + documentLoader: options.contextLoader, + keepFreeFloatingNodes: true, + }); + values = + // deno-lint-ignore no-explicit-any + (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); + } + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; + } + + if (\\"@type\\" in values) { + span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); + } + if (\\"@type\\" in values && + !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { + + if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Tombstone\\")) { + throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); + } + } + + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) + : undefined; + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); + } + + const superValues = structuredClone(values); + delete superValues[\\"@type\\"]; + const instance = await super.fromJsonLd(superValues, { + ...options, + // @ts-ignore: an internal option + _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, + }); + if (!(instance instanceof Tombstone)) { + throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); + } + + let shouldCacheJsonLd = instance._shouldCacheJsonLd; + const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType: (\$EntityType)[] = []; + + let _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array = values[\\"https://www.w3.org/ns/activitystreams#formerType\\"]; + + for ( + const v of _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array == null + ? [] + : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array.length === 1 && \\"@list\\" in _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0] + ? _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0][\\"@list\\"] + : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array + ) { + if (v == null) continue; + + const decoded = + (() => { + if (v == null || typeof v !== \\"object\\" || !(\\"@id\\" in v) || + typeof v[\\"@id\\"] !== \\"string\\" || v[\\"@id\\"] === \\"\\") { + return undefined; + } + const entityType = getEntityTypeById(v[\\"@id\\"]); + if (entityType == null) { + getLogger([\\"fedify\\", \\"vocab\\"]).warn( + \\"Ignoring unknown vocabulary entity type reference: {typeId}\\", + { typeId: v[\\"@id\\"] }, + ); + } + return entityType; + })() + ; + + if (typeof decoded === \\"undefined\\") { + shouldCacheJsonLd = false; + continue; + } + + if (!this._shouldCacheDecodedJsonLd(decoded)) { + shouldCacheJsonLd = false; + } + _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.push(decoded); + + } + instance.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; + const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted: (Temporal.Instant)[] = []; + + let _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array = values[\\"https://www.w3.org/ns/activitystreams#deleted\\"]; + + for ( + const v of _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array == null + ? [] + : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array.length === 1 && \\"@list\\" in _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0] + ? _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0][\\"@list\\"] + : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array + ) { + if (v == null) continue; + + const decoded = + Temporal.Instant.from( + v[\\"@value\\"].substring(19).match(/[Z+-]/) + ? v[\\"@value\\"] + : v[\\"@value\\"] + \\"Z\\" + ) + ; + + if (typeof decoded === \\"undefined\\") { + shouldCacheJsonLd = false; + continue; + } + + if (!this._shouldCacheDecodedJsonLd(decoded)) { + shouldCacheJsonLd = false; + } + _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(decoded); + + } + instance.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; + + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Tombstone.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } + instance._shouldCacheJsonLd = shouldCacheJsonLd; + if ( + shouldCacheJsonLd && + (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) + ) { + try { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const normalized = cacheJsonLd; + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + } else { + instance._cachedJsonLd = structuredClone(json); + } + } catch { + getLogger([\\"fedify\\", \\"vocab\\"]).warn( + \\"Failed to cache JSON-LD: {json}\\", + { json }, + ); + } + } + return instance; + } + + protected override _getCustomInspectProxy(): Record { + const proxy: Record = super._getCustomInspectProxy(); + const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(inspectIri(v), options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(inspectIri(v), options), + } + : v); + + if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length == 1) { + proxy.formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType[0]; + } + + if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 1 + || !(\\"formerType\\" in proxy) + && _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0) { + proxy.formerTypes = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; + } + + const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(inspectIri(v), options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(inspectIri(v), options), + } + : v); + + if (_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.length == 1) { + proxy.deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted[0]; + } + + return proxy; + } + } + + +// deno-lint-ignore no-explicit-any +(Tombstone.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = + function ( + this: Tombstone, + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"Tombstone \\" + inspect(proxy, options); + }; + +// deno-lint-ignore no-explicit-any +(Tombstone.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = + function ( + this: Tombstone, + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"Tombstone \\" + inspect(proxy, options); + }; + /** Indicates that the \`actor\` is traveling to \`target\` from \`origin\`. + * \`Travel\` is an \`IntransitiveObject\` whose \`actor\` specifies the direct object. + * If the \`target\` or \`origin\` are not specified, + * either can be determined by context. + * + */ +export class Travel extends IntransitiveActivity { + + /** + * The type URI of {@link Travel}: \`https://www.w3.org/ns/activitystreams#Travel\`. + */ + static override get typeId(): URL { + return new URL(\\"https://www.w3.org/ns/activitystreams#Travel\\"); + } + + /** + * Constructs a new instance of Travel with the given values. + * @param values The values to initialize the instance with. + * @param options The options to use for initialization. + */ + constructor( + values: + { +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} +, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + } = {}, + ) { + super(values, options);} + + /** + * Clones this instance, optionally updating it with the given values. + * + * This is a shallow copy: property arrays are copied, but nested objects + * and URLs are shared with this instance. Dereferencing accessors can cache + * fetched objects in the instance whose accessor is called. Hydrating a + * shared nested object through the clone can affect the original as well, + * and can change JSON-LD output when either is embedded in another + * object. Hydrating a top-level property of the clone does not update this + * instance's property. + * + * To resolve properties without sharing nested objects, use + * {@link Travel.deepClone} before hydration. + * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) + * for details, including how cached JSON-LD affects serialization. + * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * + * A clone never inherits a signed JSON-LD representation retained by + * \`signObject()\`: the clone may differ from the document that the proof + * covers, so embedding the original secured JSON in a parent document + * would be wrong. Sign the clone again if it has to be embedded as a + * secured child. + * + * @param values The values to update the clone with. + * @param options The options to use for cloning. + * @returns The cloned instance with its own property arrays. Nested objects + * and URLs are shared with this instance. + */ + override clone( + values: + { +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {} + ): Travel { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: \$warning is not recognized as a property, but it is. + options = { ...options, \$warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as Travel; + return clone; + } + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Travel { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + + /** + * Converts this object to a JSON-LD structure. + * @param options The options to use. + * - \`format\`: The format of the output: \`compact\` or + \`expand\`. + * - \`contextLoader\`: The loader for remote JSON-LD contexts. + * - \`context\`: The JSON-LD context to use. Not applicable + when \`format\` is set to \`'expand'\`. + * @returns The JSON-LD representation of this object. + */ + override async toJsonLd(options: { + format?: \\"compact\\" | \\"expand\\", + contextLoader?: DocumentLoader, + context?: string | Record | (string | Record)[], + } = {}): Promise { + if (options.format == null && this._cachedJsonLd != null) { + return this._cachedJsonLd; + } + if (options.format !== \\"compact\\" && options.context != null) { + throw new TypeError( + \\"The context option can only be used when the format option is set \\" + + \\"to 'compact'.\\" + ); + } + options = { + ...options, + contextLoader: options.contextLoader ?? getDocumentLoader(), + }; + // Joins the enclosing frame's signed-value scope, or starts one when this + // frame is the outermost. Only the owning frame puts retained signed + // child documents back in place of their placeholders. + const signedValues = enterSignedValueScope(options); + // deno-lint-ignore no-unused-vars prefer-const let array: unknown[]; @@ -166167,50 +182723,7 @@ get formerTypes(): (\$EntityType)[] { unknown[] | { \\"@list\\": unknown[] } | string >; - array = []; - for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { - let element = ( - { \\"@id\\": v.typeId.href } - ); - if (Array.isArray(element)) { - if (element.length < 1) continue; - if (element.length == 1) element = element[0]; - } - if (typeof element === \\"undefined\\") continue; - array.push(element);; - } - if (array.length > 0) { - const propValue = ( - array - ); - values[\\"https://www.w3.org/ns/activitystreams#formerType\\"] = propValue; - - } - - array = []; - for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { - let element = ( - { - \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", - \\"@value\\": v.toString(), - } - ); - if (Array.isArray(element)) { - if (element.length < 1) continue; - if (element.length == 1) element = element[0]; - } - if (typeof element === \\"undefined\\") continue; - array.push(element);; - } - if (array.length > 0) { - const propValue = ( - array - ); - values[\\"https://www.w3.org/ns/activitystreams#deleted\\"] = propValue; - - } - - values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Tombstone\\"]; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Travel\\"]; if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( @@ -166222,7 +182735,7 @@ get formerTypes(): (\$EntityType)[] { ); } let docContext: Parameters[1] = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; if (options.context == null) { const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; @@ -166275,14 +182788,11 @@ get formerTypes(): (\$EntityType)[] { protected override isCompactable(): boolean { - if ( - this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType != null && - this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0 - ) return false; - return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -166307,7 +182817,7 @@ get formerTypes(): (\$EntityType)[] { verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); const tracer = tracerProvider.getTracer( \\"@fedify/vocab-tools\\", @@ -166317,7 +182827,7 @@ get formerTypes(): (\$EntityType)[] { \\"activitypub.parse_object\\", async (span) => { try { - const object = await this.__fromJsonLd__Tombstone__( + const object = await this.__fromJsonLd__Travel__( json, span, options); if (object.id != null) { span.setAttribute(\\"activitypub.object.id\\", object.id.href); @@ -166336,7 +182846,7 @@ get formerTypes(): (\$EntityType)[] { ); } - protected static async __fromJsonLd__Tombstone__( + protected static async __fromJsonLd__Travel__( json: unknown, span: Span, options: { @@ -166346,7 +182856,7 @@ get formerTypes(): (\$EntityType)[] { verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { if (typeof json === \\"undefined\\") { throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); } @@ -166393,7 +182903,7 @@ get formerTypes(): (\$EntityType)[] { if (\\"@type\\" in values && !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { - if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Tombstone\\")) { + if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Travel\\")) { throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); } } @@ -166415,88 +182925,26 @@ get formerTypes(): (\$EntityType)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); - if (!(instance instanceof Tombstone)) { + if (!(instance instanceof Travel)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); } let shouldCacheJsonLd = instance._shouldCacheJsonLd; - const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType: (\$EntityType)[] = []; - - let _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array = values[\\"https://www.w3.org/ns/activitystreams#formerType\\"]; - - for ( - const v of _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array == null - ? [] - : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array.length === 1 && \\"@list\\" in _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0] - ? _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0][\\"@list\\"] - : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array - ) { - if (v == null) continue; - - const decoded = - (() => { - if (v == null || typeof v !== \\"object\\" || !(\\"@id\\" in v) || - typeof v[\\"@id\\"] !== \\"string\\" || v[\\"@id\\"] === \\"\\") { - return undefined; - } - const entityType = getEntityTypeById(v[\\"@id\\"]); - if (entityType == null) { - getLogger([\\"fedify\\", \\"vocab\\"]).warn( - \\"Ignoring unknown vocabulary entity type reference: {typeId}\\", - { typeId: v[\\"@id\\"] }, - ); - } - return entityType; - })() - ; - - if (typeof decoded === \\"undefined\\") { - shouldCacheJsonLd = false; - continue; - } - - if (!this._shouldCacheDecodedJsonLd(decoded)) { - shouldCacheJsonLd = false; - } - _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.push(decoded); - - } - instance.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; - const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted: (Temporal.Instant)[] = []; - - let _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array = values[\\"https://www.w3.org/ns/activitystreams#deleted\\"]; - - for ( - const v of _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array == null - ? [] - : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array.length === 1 && \\"@list\\" in _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0] - ? _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0][\\"@list\\"] - : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array + + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false ) { - if (v == null) continue; - - const decoded = - Temporal.Instant.from( - v[\\"@value\\"].substring(19).match(/[Z+-]/) - ? v[\\"@value\\"] - : v[\\"@value\\"] + \\"Z\\" - ) - ; - - if (typeof decoded === \\"undefined\\") { - shouldCacheJsonLd = false; - continue; - } - - if (!this._shouldCacheDecodedJsonLd(decoded)) { - shouldCacheJsonLd = false; - } - _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(decoded); - + const retained = retainRawProperties( + values, + Travel.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); } - instance.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; - instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -166528,96 +182976,53 @@ get formerTypes(): (\$EntityType)[] { protected override _getCustomInspectProxy(): Record { const proxy: Record = super._getCustomInspectProxy(); - const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType - // deno-lint-ignore no-explicit-any - .map((v: any) => v instanceof URL - ? { - [Symbol.for(\\"Deno.customInspect\\")]: ( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string => \\"URL \\" + inspect(inspectIri(v), options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(inspectIri(v), options), - } - : v); - - if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length == 1) { - proxy.formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType[0]; - } - - if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 1 - || !(\\"formerType\\" in proxy) - && _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0) { - proxy.formerTypes = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; - } - - const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted - // deno-lint-ignore no-explicit-any - .map((v: any) => v instanceof URL - ? { - [Symbol.for(\\"Deno.customInspect\\")]: ( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string => \\"URL \\" + inspect(inspectIri(v), options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(inspectIri(v), options), - } - : v); - - if (_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.length == 1) { - proxy.deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted[0]; - } - return proxy; } } // deno-lint-ignore no-explicit-any -(Tombstone.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = +(Travel.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = function ( - this: Tombstone, + this: Travel, inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Tombstone \\" + inspect(proxy, options); + return \\"Travel \\" + inspect(proxy, options); }; // deno-lint-ignore no-explicit-any -(Tombstone.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = +(Travel.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = function ( - this: Tombstone, + this: Travel, _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Tombstone \\" + inspect(proxy, options); + return \\"Travel \\" + inspect(proxy, options); }; - /** Indicates that the \`actor\` is traveling to \`target\` from \`origin\`. - * \`Travel\` is an \`IntransitiveObject\` whose \`actor\` specifies the direct object. - * If the \`target\` or \`origin\` are not specified, - * either can be determined by context. + /** Indicates that the \`actor\` is undoing the \`object\`. In most cases, + * the \`object\` will be an {@link Activity} describing some previously performed + * action (for instance, a person may have previously \\"liked\\" an article but, + * for whatever reason, might choose to undo that like at some later point in + * time). + * + * The \`target\` and \`origin\` typically have no defined meaning. * */ -export class Travel extends IntransitiveActivity { +export class Undo extends Activity { /** - * The type URI of {@link Travel}: \`https://www.w3.org/ns/activitystreams#Travel\`. + * The type URI of {@link Undo}: \`https://www.w3.org/ns/activitystreams#Undo\`. */ static override get typeId(): URL { - return new URL(\\"https://www.w3.org/ns/activitystreams#Travel\\"); + return new URL(\\"https://www.w3.org/ns/activitystreams#Undo\\"); } /** - * Constructs a new instance of Travel with the given values. + * Constructs a new instance of Undo with the given values. * @param values The values to initialize the instance with. * @param options The options to use for initialization. */ @@ -166670,10 +183075,14 @@ instruments?: (Object | URL)[];} * instance's property. * * To resolve properties without sharing nested objects, use - * {@link Travel.deepClone} before hydration. + * {@link Undo.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -166719,7 +183128,7 @@ instruments?: (Object | URL)[];} contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, } = {} - ): Travel { + ): Undo { if (this._warning != null) { getLogger(this._warning.category).warn( this._warning.message, @@ -166728,7 +183137,7 @@ instruments?: (Object | URL)[];} // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Travel; + const clone = super.clone(values, options) as unknown as Undo; return clone; } @@ -166745,9 +183154,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -166797,7 +183207,7 @@ instruments?: (Object | URL)[];} documentLoader?: DocumentLoader, contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, - } = {}): Travel { + } = {}): Undo { const cloneOptions = { documentLoader: options.documentLoader ?? this._documentLoader, contextLoader: options.contextLoader ?? this._contextLoader, @@ -166854,7 +183264,7 @@ instruments?: (Object | URL)[];} unknown[] | { \\"@list\\": unknown[] } | string >; - values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Travel\\"]; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Undo\\"]; if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( @@ -166866,7 +183276,7 @@ instruments?: (Object | URL)[];} ); } let docContext: Parameters[1] = options.context ?? - [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"litepub\\":\\"http://litepub.social/ns#\\",\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"EmojiReact\\":\\"litepub:EmojiReact\\",\\"Emoji\\":\\"toot:Emoji\\"}]; if (options.context == null) { const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; @@ -166922,6 +183332,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -166946,7 +183358,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); const tracer = tracerProvider.getTracer( \\"@fedify/vocab-tools\\", @@ -166956,7 +183368,7 @@ instruments?: (Object | URL)[];} \\"activitypub.parse_object\\", async (span) => { try { - const object = await this.__fromJsonLd__Travel__( + const object = await this.__fromJsonLd__Undo__( json, span, options); if (object.id != null) { span.setAttribute(\\"activitypub.object.id\\", object.id.href); @@ -166975,7 +183387,7 @@ instruments?: (Object | URL)[];} ); } - protected static async __fromJsonLd__Travel__( + protected static async __fromJsonLd__Undo__( json: unknown, span: Span, options: { @@ -166985,7 +183397,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { if (typeof json === \\"undefined\\") { throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); } @@ -167032,7 +183444,7 @@ instruments?: (Object | URL)[];} if (\\"@type\\" in values && !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { - if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Travel\\")) { + if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Undo\\")) { throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); } } @@ -167054,13 +183466,26 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); - if (!(instance instanceof Travel)) { + if (!(instance instanceof Undo)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); } let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Undo.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -167098,47 +183523,45 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any -(Travel.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = +(Undo.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = function ( - this: Travel, + this: Undo, inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Travel \\" + inspect(proxy, options); + return \\"Undo \\" + inspect(proxy, options); }; // deno-lint-ignore no-explicit-any -(Travel.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = +(Undo.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = function ( - this: Travel, + this: Undo, _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Travel \\" + inspect(proxy, options); + return \\"Undo \\" + inspect(proxy, options); }; - /** Indicates that the \`actor\` is undoing the \`object\`. In most cases, - * the \`object\` will be an {@link Activity} describing some previously performed - * action (for instance, a person may have previously \\"liked\\" an article but, - * for whatever reason, might choose to undo that like at some later point in - * time). + /** Indicates that the \`actor\` has updated the \`object\`. Note, however, + * that this vocabulary does not define a mechanism for describing the actual + * set of modifications made to \`object\`. * * The \`target\` and \`origin\` typically have no defined meaning. * */ -export class Undo extends Activity { +export class Update extends Activity { /** - * The type URI of {@link Undo}: \`https://www.w3.org/ns/activitystreams#Undo\`. + * The type URI of {@link Update}: \`https://www.w3.org/ns/activitystreams#Update\`. */ static override get typeId(): URL { - return new URL(\\"https://www.w3.org/ns/activitystreams#Undo\\"); + return new URL(\\"https://www.w3.org/ns/activitystreams#Update\\"); } /** - * Constructs a new instance of Undo with the given values. + * Constructs a new instance of Update with the given values. * @param values The values to initialize the instance with. * @param options The options to use for initialization. */ @@ -167191,10 +183614,14 @@ instruments?: (Object | URL)[];} * instance's property. * * To resolve properties without sharing nested objects, use - * {@link Undo.deepClone} before hydration. + * {@link Update.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -167240,7 +183667,7 @@ instruments?: (Object | URL)[];} contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, } = {} - ): Undo { + ): Update { if (this._warning != null) { getLogger(this._warning.category).warn( this._warning.message, @@ -167249,7 +183676,7 @@ instruments?: (Object | URL)[];} // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Undo; + const clone = super.clone(values, options) as unknown as Update; return clone; } @@ -167266,9 +183693,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -167318,7 +183746,7 @@ instruments?: (Object | URL)[];} documentLoader?: DocumentLoader, contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, - } = {}): Undo { + } = {}): Update { const cloneOptions = { documentLoader: options.documentLoader ?? this._documentLoader, contextLoader: options.contextLoader ?? this._contextLoader, @@ -167375,7 +183803,7 @@ instruments?: (Object | URL)[];} unknown[] | { \\"@list\\": unknown[] } | string >; - values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Undo\\"]; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Update\\"]; if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( @@ -167387,7 +183815,7 @@ instruments?: (Object | URL)[];} ); } let docContext: Parameters[1] = options.context ?? - [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"litepub\\":\\"http://litepub.social/ns#\\",\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"EmojiReact\\":\\"litepub:EmojiReact\\",\\"Emoji\\":\\"toot:Emoji\\"}]; + [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"sensitive\\":\\"as:sensitive\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"attributionDomains\\":{\\"@id\\":\\"toot:attributionDomains\\",\\"@container\\":\\"@set\\"},\\"votersCount\\":{\\"@id\\":\\"toot:votersCount\\",\\"@type\\":\\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\"},\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; if (options.context == null) { const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; @@ -167443,6 +183871,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -167467,7 +183897,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); const tracer = tracerProvider.getTracer( \\"@fedify/vocab-tools\\", @@ -167477,7 +183907,7 @@ instruments?: (Object | URL)[];} \\"activitypub.parse_object\\", async (span) => { try { - const object = await this.__fromJsonLd__Undo__( + const object = await this.__fromJsonLd__Update__( json, span, options); if (object.id != null) { span.setAttribute(\\"activitypub.object.id\\", object.id.href); @@ -167496,7 +183926,7 @@ instruments?: (Object | URL)[];} ); } - protected static async __fromJsonLd__Undo__( + protected static async __fromJsonLd__Update__( json: unknown, span: Span, options: { @@ -167506,7 +183936,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { if (typeof json === \\"undefined\\") { throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); } @@ -167553,7 +183983,7 @@ instruments?: (Object | URL)[];} if (\\"@type\\" in values && !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { - if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Undo\\")) { + if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Update\\")) { throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); } } @@ -167575,532 +184005,26 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); - if (!(instance instanceof Undo)) { + if (!(instance instanceof Update)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); } let shouldCacheJsonLd = instance._shouldCacheJsonLd; - instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( - shouldCacheJsonLd && - (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false ) { - try { - if (cacheJsonLd != null && cacheJsonLd !== expanded) { - const compactArray = Array.isArray(json) && json.length === 1; - const jsonLd = compactArray ? json[0] : json; - const normalized = cacheJsonLd; - const cachedJsonLd = await compactJsonLdCache( - normalized, - jsonLd, - options.contextLoader, - ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; - } else { - instance._cachedJsonLd = structuredClone(json); - } - } catch { - getLogger([\\"fedify\\", \\"vocab\\"]).warn( - \\"Failed to cache JSON-LD: {json}\\", - { json }, - ); - } - } - return instance; - } - - protected override _getCustomInspectProxy(): Record { - const proxy: Record = super._getCustomInspectProxy(); - return proxy; - } - } - - -// deno-lint-ignore no-explicit-any -(Undo.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = - function ( - this: Undo, - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string { - const proxy = this._getCustomInspectProxy(); - return \\"Undo \\" + inspect(proxy, options); - }; - -// deno-lint-ignore no-explicit-any -(Undo.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = - function ( - this: Undo, - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string { - const proxy = this._getCustomInspectProxy(); - return \\"Undo \\" + inspect(proxy, options); - }; - /** Indicates that the \`actor\` has updated the \`object\`. Note, however, - * that this vocabulary does not define a mechanism for describing the actual - * set of modifications made to \`object\`. - * - * The \`target\` and \`origin\` typically have no defined meaning. - * - */ -export class Update extends Activity { - - /** - * The type URI of {@link Update}: \`https://www.w3.org/ns/activitystreams#Update\`. - */ - static override get typeId(): URL { - return new URL(\\"https://www.w3.org/ns/activitystreams#Update\\"); - } - - /** - * Constructs a new instance of Update with the given values. - * @param values The values to initialize the instance with. - * @param options The options to use for initialization. - */ - constructor( - values: - { -id?: URL | null; -attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; -attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; -audiences?: (Object | URL)[];content?: string | LanguageString | null; -contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; -names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; -icons?: (Image | URL)[];image?: Image | URL | null; -images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; -replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; -locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; -previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; -summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; -urls?: ((URL | Link))[];to?: Object | URL | null; -tos?: (Object | URL)[];bto?: Object | URL | null; -btos?: (Object | URL)[];cc?: Object | URL | null; -ccs?: (Object | URL)[];bcc?: Object | URL | null; -bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; -actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; -objects?: (Object | URL)[];target?: Object | URL | null; -targets?: (Object | URL)[];result?: Object | URL | null; -results?: (Object | URL)[];origin?: Object | URL | null; -origins?: (Object | URL)[];instrument?: Object | URL | null; -instruments?: (Object | URL)[];} -, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, - verifyPortableObject?: PortableObjectVerifier, - } = {}, - ) { - super(values, options);} - - /** - * Clones this instance, optionally updating it with the given values. - * - * This is a shallow copy: property arrays are copied, but nested objects - * and URLs are shared with this instance. Dereferencing accessors can cache - * fetched objects in the instance whose accessor is called. Hydrating a - * shared nested object through the clone can affect the original as well, - * and can change JSON-LD output when either is embedded in another - * object. Hydrating a top-level property of the clone does not update this - * instance's property. - * - * To resolve properties without sharing nested objects, use - * {@link Update.deepClone} before hydration. - * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) - * for details, including how cached JSON-LD affects serialization. - * - * A clone never inherits a signed JSON-LD representation retained by - * \`signObject()\`: the clone may differ from the document that the proof - * covers, so embedding the original secured JSON in a parent document - * would be wrong. Sign the clone again if it has to be embedded as a - * secured child. - * - * @param values The values to update the clone with. - * @param options The options to use for cloning. - * @returns The cloned instance with its own property arrays. Nested objects - * and URLs are shared with this instance. - */ - override clone( - values: - { -id?: URL | null; -attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; -attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; -audiences?: (Object | URL)[];content?: string | LanguageString | null; -contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; -names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; -icons?: (Image | URL)[];image?: Image | URL | null; -images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; -replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; -locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; -previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; -summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; -urls?: ((URL | Link))[];to?: Object | URL | null; -tos?: (Object | URL)[];bto?: Object | URL | null; -btos?: (Object | URL)[];cc?: Object | URL | null; -ccs?: (Object | URL)[];bcc?: Object | URL | null; -bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; -actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; -objects?: (Object | URL)[];target?: Object | URL | null; -targets?: (Object | URL)[];result?: Object | URL | null; -results?: (Object | URL)[];origin?: Object | URL | null; -origins?: (Object | URL)[];instrument?: Object | URL | null; -instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): Update { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: \$warning is not recognized as a property, but it is. - options = { ...options, \$warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as Update; - return clone; - } - - /** - * Copies this instance and its nested vocabulary objects, optionally - * replacing property values. Replacement values are copied too. - * - * Property arrays, URLs and byte arrays are independent of the source. - * Repeated references remain shared within the copy. References to this - * source in replacement values receive a separate copy of its pre-update - * values, rather than referring back to the updated root. - * Other scalar values, including opaque cryptographic keys, are shared. - * - * Each copied object retains its own default loaders, tracer, verifier - * and base URL. Options override defaults only on the root instance. - * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. - * - * Trust and portable provenance follow clone() rules at every level. - * Historical referrers within the graph are copied without replacements; - * referrers outside the graph still point at the original external objects. - * Custom clone() overrides must return fresh, compatible instances and - * remain responsible for their own constructor and cloning side effects. - * Large sparse property arrays with ordinary data entries are copied using - * a snapshot of their length and present indices. Entries added after a - * snapshot are not visited; deleted entries are skipped, and values changed - * after the snapshot are read when reached. Custom - * clone() overrides must avoid structurally changing a field being copied - * if they need all its nested objects to be independent of the source. - * - * @param values The values to replace before copying the graph. - * @param options Root loader and verifier overrides. Undefined options - * retain the corresponding defaults. - * @returns An independent copy of the stored vocabulary graph. - * @since 2.5.0 - */ - override deepClone(values: -{ -id?: URL | null; -attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; -attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; -audiences?: (Object | URL)[];content?: string | LanguageString | null; -contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; -names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; -icons?: (Image | URL)[];image?: Image | URL | null; -images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; -replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; -locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; -previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; -summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; -urls?: ((URL | Link))[];to?: Object | URL | null; -tos?: (Object | URL)[];bto?: Object | URL | null; -btos?: (Object | URL)[];cc?: Object | URL | null; -ccs?: (Object | URL)[];bcc?: Object | URL | null; -bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; -actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; -objects?: (Object | URL)[];target?: Object | URL | null; -targets?: (Object | URL)[];result?: Object | URL | null; -results?: (Object | URL)[];origin?: Object | URL | null; -origins?: (Object | URL)[];instrument?: Object | URL | null; -instruments?: (Object | URL)[];} -= {}, options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {}): Update { - const cloneOptions = { - documentLoader: options.documentLoader ?? this._documentLoader, - contextLoader: options.contextLoader ?? this._contextLoader, - verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, - tracerProvider: this._tracerProvider, - baseUrl: this._baseUrl, - }; - return deepCloneGraph(this, this.clone(values, cloneOptions)); - } - - /** - * Converts this object to a JSON-LD structure. - * @param options The options to use. - * - \`format\`: The format of the output: \`compact\` or - \`expand\`. - * - \`contextLoader\`: The loader for remote JSON-LD contexts. - * - \`context\`: The JSON-LD context to use. Not applicable - when \`format\` is set to \`'expand'\`. - * @returns The JSON-LD representation of this object. - */ - override async toJsonLd(options: { - format?: \\"compact\\" | \\"expand\\", - contextLoader?: DocumentLoader, - context?: string | Record | (string | Record)[], - } = {}): Promise { - if (options.format == null && this._cachedJsonLd != null) { - return this._cachedJsonLd; - } - if (options.format !== \\"compact\\" && options.context != null) { - throw new TypeError( - \\"The context option can only be used when the format option is set \\" + - \\"to 'compact'.\\" - ); - } - options = { - ...options, - contextLoader: options.contextLoader ?? getDocumentLoader(), - }; - // Joins the enclosing frame's signed-value scope, or starts one when this - // frame is the outermost. Only the owning frame puts retained signed - // child documents back in place of their placeholders. - const signedValues = enterSignedValueScope(options); - - // deno-lint-ignore no-unused-vars prefer-const - let array: unknown[]; - - const baseValues = await super.toJsonLd({ - ...options, - format: \\"expand\\", - context: undefined, - }) as unknown[]; - const values = baseValues[0] as Record< - string, - unknown[] | { \\"@list\\": unknown[] } | string - >; - - values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Update\\"]; - if (this.id != null) values[\\"@id\\"] = formatIri(this.id); - if (options.format === \\"expand\\") { - return await jsonld.expand( + const retained = retainRawProperties( values, - { - documentLoader: options.contextLoader, - keepFreeFloatingNodes: true, - }, - ); - } - let docContext: Parameters[1] = options.context ?? - [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"sensitive\\":\\"as:sensitive\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"attributionDomains\\":{\\"@id\\":\\"toot:attributionDomains\\",\\"@container\\":\\"@set\\"},\\"votersCount\\":{\\"@id\\":\\"toot:votersCount\\",\\"@type\\":\\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\"},\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; - - if (options.context == null) { - const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; - const additionalContexts = getExtraContexts(values).filter( - context => !currentContexts.includes(context) - ); - if (additionalContexts.length > 0) { - docContext = [...currentContexts, ...additionalContexts]; - } - } - - let compacted = await jsonld.compact( - values, - docContext, - { documentLoader: options.contextLoader }, - ); - - if (options.context == null) { - const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; - const additionalContexts = getExtraContexts(compacted).filter( - context => !currentContexts.includes(context) + Update.#knownRawPropertyIris, ); - if (additionalContexts.length > 0) { - docContext = [...currentContexts, ...additionalContexts]; - compacted = await jsonld.compact(values, docContext, { - documentLoader: options.contextLoader, - }); - } - } - - if (docContext != null) { - // Embed context - - if (\\"proof\\" in compacted && - compacted.proof != null) { - if (Array.isArray(compacted.proof)) { - for (const element of compacted.proof) { - element[\\"@context\\"] = docContext; - } - } else { - compacted.proof[\\"@context\\"] = docContext; - } - } - + if (retained != null) retainedRawProperties.set(instance, retained); } - return signedValues.owner - ? resolveSignedValues(compacted, signedValues.scope) - : compacted; - } - - protected override isCompactable(): boolean { - - return super.isCompactable(); - } - - /** - * Converts a JSON-LD structure to an object of this type. - * @param json The JSON-LD structure to convert. - * @param options The options to use. - * - \`documentLoader\`: The loader for remote JSON-LD documents. - * - \`contextLoader\`: The loader for remote JSON-LD contexts. - * - \`tracerProvider\`: The OpenTelemetry tracer provider to use. - * If omitted, the global tracer provider is used. - * - \`verifyPortableObject\`: The default FEP-ef61 portable - * object verifier for the property accessors of the - * returned object and the objects obtained from it. It - * does not verify the given \`json\` itself. - * @returns The object of this type. - * @throws {TypeError} If the given \`json\` is invalid. - */ - static override async fromJsonLd( - json: unknown, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, - verifyPortableObject?: PortableObjectVerifier, - baseUrl?: URL, - } = {}, - ): Promise { - const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); - const tracer = tracerProvider.getTracer( - \\"@fedify/vocab-tools\\", - \\"0.0.0\\", - ); - return await tracer.startActiveSpan( - \\"activitypub.parse_object\\", - async (span) => { - try { - const object = await this.__fromJsonLd__Update__( - json, span, options); - if (object.id != null) { - span.setAttribute(\\"activitypub.object.id\\", object.id.href); - } - return object; - } catch (error) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: String(error), - }); - throw error; - } finally { - span.end(); - } - }, - ); - } - - protected static async __fromJsonLd__Update__( - json: unknown, - span: Span, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, - verifyPortableObject?: PortableObjectVerifier, - baseUrl?: URL, - } = {}, - ): Promise { - if (typeof json === \\"undefined\\") { - throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); - } - else if (json === null) throw new TypeError(\\"Invalid JSON-LD: null.\\"); - options = { - ...options, - documentLoader: options.documentLoader ?? getDocumentLoader(), - contextLoader: options.contextLoader ?? getDocumentLoader(), - tracerProvider: options.tracerProvider ?? trace.getTracerProvider(), - }; - // deno-lint-ignore no-explicit-any - let values: Record & { \\"@id\\"?: string }; - let expanded: unknown[]; - if ( - \\"_fromSubclass\\" in options && - options._fromSubclass && - typeof json === \\"object\\" && - !Array.isArray(json) - ) { - values = - // deno-lint-ignore no-explicit-any - json as (Record & { \\"@id\\"?: string }); - expanded = [values]; - } else if (globalThis.Object.keys(json).length == 0) { - values = {}; - expanded = [values]; - } else { - expanded = await jsonld.expand(json, { - documentLoader: options.contextLoader, - keepFreeFloatingNodes: true, - }); - values = - // deno-lint-ignore no-explicit-any - (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); - } - const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); - if (id != null && options.baseUrl == null) { - options = { ...options, baseUrl: id }; - } - - if (\\"@type\\" in values) { - span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); - } - if (\\"@type\\" in values && - !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { - - if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Update\\")) { - throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); - } - } - - let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizeJsonLdIris( - expanded, - PORTABLE_IRI_KEYS, - PORTABLE_IRI_PATTERN, - ) - : undefined; - if (cacheJsonLd != null && cacheJsonLd !== expanded) { - cacheJsonLd = structuredClone(cacheJsonLd); - } - - const superValues = structuredClone(values); - delete superValues[\\"@type\\"]; - const instance = await super.fromJsonLd(superValues, { - ...options, - // @ts-ignore: an internal option - _fromSubclass: true, - }); - if (!(instance instanceof Update)) { - throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); - } - - let shouldCacheJsonLd = instance._shouldCacheJsonLd; - instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -168222,6 +184146,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -168287,9 +184215,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -168477,6 +184406,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -168609,6 +184540,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Video)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -168616,6 +184550,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Video.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -168744,6 +184688,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -168815,9 +184763,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -168992,6 +184941,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -169124,6 +185075,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof View)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -169131,6 +185085,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + View.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 8e7e1afc8..d50bdec1d 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -25,7 +25,9 @@ import { parseIri, parseJsonLdId, type PortableObjectVerifier, - type RemoteDocument + type RawPropertyValue, + type RemoteDocument, + type VocabularyObject } from \\"@fedify/vocab-runtime\\"; import { compactJsonLdCache, @@ -54,6 +56,16 @@ import { rejectMalformedCompatibleReference, warnUnverifiableEmbeddedObject } from \\"@fedify/vocab-runtime/internal/portable-dereference\\"; +import { + createRawPropertyEncodingOptions, + encodeNestedVocabularyValue, + expandRawPropertyValue, + RAW_PROPERTY_PROTOCOL, + type RawPropertyRequest, + readRawPropertyValues, + retainRawProperties, + type RetainedRawProperties +} from \\"@fedify/vocab-runtime/internal/raw-property\\"; import { enterSignedValueScope, resolveSignedValues, @@ -367,6 +379,221 @@ function deepCloneGraph(source: object, root: T): T { return root; } +type RawPropertyEncoder = ( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, +) => Promise; + +interface RawPropertyDescriptor { + readonly canonicalIri: string; + readonly encode: RawPropertyEncoder; + readonly values: (object: object) => readonly unknown[]; +} + +// Unknown properties retained while decoding, keyed by the decoded object: +const retainedRawProperties = new WeakMap(); + +// Encoders of the properties each generated class declares, keyed by the +// class's prototype and then by the property IRIs, including aliases: +const rawPropertyDescriptors = new Map< + object, + ReadonlyMap +>(); + +function getRawPropertyDescriptor( + object: object, + iri: string, +): RawPropertyDescriptor | undefined { + let prototype: object | null = globalThis.Object.getPrototypeOf(object); + while (prototype != null) { + const descriptor = rawPropertyDescriptors.get(prototype)?.get(iri); + if (descriptor != null) return descriptor; + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return undefined; +} + +function copyRawProperties(source: object, destination: object): void { + const retained = retainedRawProperties.get(source); + if (retained == null) retainedRawProperties.delete(destination); + else retainedRawProperties.set(destination, retained); +} + +function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { + if ( + source == null || destination == null || + typeof source !== \\"object\\" || typeof destination !== \\"object\\" || + !(RAW_PROPERTY_PROTOCOL in source) || + globalThis.Object.getPrototypeOf(source) !== + globalThis.Object.getPrototypeOf(destination) + ) { + return false; + } + const sourceId = (source as unknown as { id: URL | null }).id; + const destinationId = (destination as unknown as { id: URL | null }).id; + return sourceId?.href === destinationId?.href; +} + +// Copies the retained unknown properties of a decoded object and of the +// objects nested in it to a copy of the same graph that was decoded again, +// pairing nested objects by property and position: +function copyRawPropertiesDeep( + source: object, + destination: object, + visited: Set = new Set(), +): void { + if (visited.has(destination)) return; + visited.add(destination); + copyRawProperties(source, destination); + if (!isSameRawPropertyNode(source, destination)) return; + const descriptors = new Set(); + let prototype: object | null = globalThis.Object.getPrototypeOf(destination); + while (prototype != null) { + for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { + descriptors.add(descriptor); + } + prototype = globalThis.Object.getPrototypeOf(prototype); + } + for (const descriptor of descriptors) { + const sources = descriptor.values(source); + const destinations = descriptor.values(destination); + const length = globalThis.Math.min(sources.length, destinations.length); + for (let i = 0; i < length; i++) { + if ( + sources[i] !== destinations[i] && + isSameRawPropertyNode(sources[i], destinations[i]) + ) { + copyRawPropertiesDeep( + sources[i] as object, + destinations[i] as object, + visited, + ); + } + } + } +} + +async function readRawProperty( + object: object, + request: RawPropertyRequest, + contextLoader: DocumentLoader, +): Promise { + const retained = retainedRawProperties.get(object); + for (const iri of request.candidates) { + const descriptor = getRawPropertyDescriptor(object, iri); + if (descriptor != null) { + const value = await descriptor.encode( + object, + createRawPropertyEncodingOptions(request.stack, contextLoader), + ); + return value === undefined ? [] : await expandRawPropertyValue( + descriptor.canonicalIri, + value, + contextLoader, + ); + } + if (retained != null && globalThis.Object.hasOwn(retained, iri)) { + return retained[iri]; + } + } + return []; +} + +/** + * Gets the values of a property of a vocabulary object in expanded JSON-LD, + * looking the property up by its full IRI. This works for properties that + * have no typed accessor as well as for those that do. + * + * *Raw* means untyped expanded JSON-LD values, such as + * \`{ \\"@value\\": \\"Hello\\" }\` or \`{ \\"@id\\": \\"https://example.com/\\" }\`, as + * opposed to the values that typed accessors return. It does not mean the + * received document: + * + * - For a property that the object's class has no accessor for, the result + * is the values retained when the object was decoded by \`fromJsonLd()\`. + * Objects constructed locally have none. + * - For a property that the class has an accessor for, including a + * redundant alias of such a property, the result is the current typed + * values encoded back into expanded JSON-LD. It reflects \`clone()\` + * replacements and objects fetched by dereferencing accessors, and it can + * differ from the received values: for example, values that failed to + * decode are missing, and lexical forms such as date-times are + * normalized. When a later release adds an accessor for a property, + * the result for that property switches from the retained values to the + * encoded ones. + * + * The values are not verified in any way, and IRIs in them are never + * dereferenced. Validate them before use, as with any other data received + * from a remote server. The result is a deep copy, so modifying it does not + * affect the object. + * + * The IRI is matched as given, and then as normalized by the WHATWG URL + * parser. Prefixes are never expanded: \`\\"as:content\\"\` is a valid IRI with + * the \`as:\` scheme, so it normally matches nothing. An IRI whose scheme is + * not \`http:\` or \`https:\` is therefore logged as a warning under the + * \`[\\"fedify\\", \\"vocab\\"]\` category. + * + * \`\`\`typescript ignore + * const values = await getRawPropertyValues( + * note, + * \\"https://w3id.org/quantpub#structuredUrl\\", + * ); + * for (const value of values) { + * if (\\"@id\\" in value && typeof value[\\"@id\\"] === \\"string\\") { + * console.log(new URL(value[\\"@id\\"])); + * } + * } + * \`\`\` + * + * @param object The vocabulary object to read. It can be an object of any + * module generated by \`@fedify/vocab-tools\`. + * @param propertyIri The full IRI of the property. + * @returns The values of the property, or an empty array if it has none. + * @throws {TypeError} If \`propertyIri\` is not an absolute IRI, e.g., an + * empty string, a JSON-LD keyword such as \`\\"@id\\"\`, a + * blank node identifier, a term, or a relative + * reference; if \`object\` is not a generated vocabulary + * object; or if encoding the values of a known property + * meets a cycle of objects. + * @since 2.5.0 + */ +export function getRawPropertyValues( + object: VocabularyObject, + propertyIri: string | URL, +): Promise { + return readRawPropertyValues(object, propertyIri, \\"getRawPropertyValues\\"); +} + +/** + * Gets the first value of a property of a vocabulary object in expanded + * JSON-LD, looking the property up by its full IRI. It is equivalent to + * \`(await getRawPropertyValues(object, propertyIri))[0] ?? null\`; see + * {@link getRawPropertyValues} for how the values are obtained. + * + * It does not throw when the property has multiple values. JSON-LD does not + * order the values of a property unless it is a list, so the first value is + * not more significant than the others. A list property has a single value, + * the \`{ \\"@list\\": [...] }\` object. + * + * @param object The vocabulary object to read. It can be an object of any + * module generated by \`@fedify/vocab-tools\`. + * @param propertyIri The full IRI of the property. + * @returns The first value of the property, or \`null\` if it has none. + * @throws {TypeError} In the same cases as {@link getRawPropertyValues}. + * @since 2.5.0 + */ +export async function getRawPropertyValue( + object: VocabularyObject, + propertyIri: string | URL, +): Promise { + const values = await readRawPropertyValues( + object, + propertyIri, + \\"getRawPropertyValue\\", + ); + return values[0] ?? null; +} + function isValidLanguageTag(language: string): boolean { try { new Intl.Locale(normalizeLanguageTag(language)); @@ -449,7 +676,7 @@ import * as _ppM0 from \\"./preprocessors.ts\\"; * {@link OrderedCollection}. * */ -export class Object { +export class Object implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -465,6 +692,14 @@ export class Object { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -2130,6 +2365,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -2185,6 +2424,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length < vocabSparseArrayMinimumLength ? this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.slice() : vocabCopyPropertyArray(this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment);clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = vocabCopyTrustSet( this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, @@ -3769,9 +4009,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -4481,6 +4722,1380 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Object, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#attachment\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Link ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#attachment\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#attributedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#attributedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#audience\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#audience\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#content\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#content\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#context\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3mhZzGXSpQ431mBSz2kvych22v4e_context; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#context\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#name\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endTime\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endTime\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#generator\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#generator\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#icon\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#icon\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#image\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#image\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#inReplyTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#inReplyTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#location\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#location\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preview\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Link ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preview\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#published\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_5e258TDXtuhaFRPZiGoDfEpjdMr_published) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_5e258TDXtuhaFRPZiGoDfEpjdMr_published; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#published\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#replies\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_7UpwM3JWcXhADcscukEehBorf6k_replies) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_7UpwM3JWcXhADcscukEehBorf6k_replies; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#replies\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#shares\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3kAfck9PcEYt2L7xug5y99YPbANs_shares; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#shares\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#likes\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#likes\\", descriptor); + + descriptor = { + canonicalIri: \\"http://fedibird.com/ns#emojiReactions\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions; + }, + }; + descriptors.set(\\"http://fedibird.com/ns#emojiReactions\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#startTime\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2w3Jmue4up8iVDUA51WZqomEF438_startTime) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2w3Jmue4up8iVDUA51WZqomEF438_startTime; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#startTime\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#summary\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#summary\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#tag\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_5chuqj6s95p5gg2sk1HntGfarRf_tag; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#tag\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#updated\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#updated\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#url\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + + let element = ( +v instanceof URL ?{ \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#url\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#to\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#to\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#bto\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#bto\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#cc\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#cc\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#bcc\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#bcc\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#mediaType\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#duration\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#duration\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#duration\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#sensitive\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#sensitive\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#source\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#source\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#proof\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push({ \\"@graph\\": element }); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; + }, + }; + descriptors.set(\\"https://w3id.org/security#proof\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionPolicy\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionPolicy\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#approvedBy\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#approvedBy\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#likeAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#likeAuthorization\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#replyAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#replyAuthorization\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#announceAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#announceAuthorization\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/22cd#translations\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations; + }, + }; + descriptors.set(\\"https://w3id.org/fep/22cd#translations\\", descriptor); + + descriptor = { + canonicalIri: \\"http://purl.org/dc/terms/license\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + }, + }; + descriptors.set(\\"http://purl.org/dc/terms/license\\", descriptor); +descriptors.set(\\"https://schema.org/license\\", descriptor); +descriptors.set(\\"http://creativecommons.org/ns#license\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchAttachment( url: URL, @@ -4884,6 +6499,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#attachment_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -4896,6 +6512,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -5367,6 +6987,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#attribution_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -5379,6 +7000,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -5531,6 +7156,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#attribution_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -5543,6 +7169,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -5953,6 +7583,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#audience_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -5965,6 +7596,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -6116,6 +7751,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#audience_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -6128,6 +7764,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -6591,6 +8231,7 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#context_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -6603,6 +8244,10 @@ get contents(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7073,6 +8718,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#generator_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -7085,6 +8731,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7518,6 +9168,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#icon_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -7530,6 +9181,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7682,6 +9337,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#icon_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -7694,6 +9350,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8127,6 +9787,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#image_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -8139,6 +9800,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8291,6 +9956,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#image_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -8303,6 +9969,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8728,6 +10398,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#replyTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -8740,6 +10411,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8891,6 +10566,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#replyTarget_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -8903,6 +10579,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9328,6 +11008,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#location_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -9340,6 +11021,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9491,6 +11176,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#location_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -9503,6 +11189,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9927,6 +11617,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#preview_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -9939,6 +11630,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10089,6 +11784,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#preview_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -10101,6 +11797,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10524,6 +12224,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#replies_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -10536,6 +12237,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10951,6 +12656,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#shares_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -10963,6 +12669,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11378,6 +13088,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#likes_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -11390,6 +13101,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11799,6 +13514,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#emojiReactions_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -11811,6 +13527,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12281,6 +14001,7 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#tag_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -12293,6 +14014,10 @@ get summaries(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12737,6 +14462,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#to_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -12749,6 +14475,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12900,6 +14630,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#to_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -12912,6 +14643,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13322,6 +15057,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#bto_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -13334,6 +15070,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13485,6 +15225,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#bto_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -13497,6 +15238,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13907,6 +15652,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#cc_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -13919,6 +15665,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14070,6 +15820,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#cc_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -14082,6 +15833,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14492,6 +16247,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#bcc_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -14504,6 +16260,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14655,6 +16415,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#bcc_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -14667,6 +16428,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15140,6 +16905,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#proof_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -15152,6 +16918,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15302,6 +17072,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#proof_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -15314,6 +17085,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15763,6 +17538,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#likeAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -15775,6 +17551,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16184,6 +17964,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#replyAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -16196,6 +17977,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16605,6 +18390,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#announceAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -16617,6 +18403,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -17534,8 +19324,21 @@ get licenses(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Link ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17554,8 +19357,29 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17574,8 +19398,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17594,6 +19423,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -17617,8 +19447,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17637,6 +19476,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -17660,6 +19500,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -17683,8 +19524,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17703,8 +19553,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17723,8 +19578,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17743,8 +19603,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17763,8 +19632,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17783,8 +19661,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17803,6 +19690,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -17826,8 +19714,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_7UpwM3JWcXhADcscukEehBorf6k_replies) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17846,8 +19739,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17866,8 +19764,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17886,8 +19789,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17906,6 +19814,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -17929,6 +19838,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -17952,8 +19862,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17972,6 +19891,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -17995,8 +19915,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + let element = ( - v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18015,8 +19940,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18035,8 +19965,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18055,8 +19990,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18075,8 +20015,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18095,6 +20040,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + let element = ( { \\"@value\\": v } ); @@ -18115,6 +20061,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#duration\\", @@ -18138,6 +20085,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive) { + let element = ( { \\"@value\\": v } ); @@ -18158,8 +20106,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18178,8 +20131,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18198,8 +20156,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18218,6 +20181,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -18238,8 +20202,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18258,8 +20227,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18278,8 +20252,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18298,8 +20277,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18318,6 +20302,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -18439,6 +20424,8 @@ get licenses(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -18872,16 +20859,31 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"http://schema.org#PropertyValue\\") ? await PropertyValue.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -18923,23 +20925,48 @@ get licenses(): (URL)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -18980,7 +21007,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19056,12 +21088,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19170,12 +21212,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19239,7 +21291,12 @@ get licenses(): (URL)[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19303,7 +21360,12 @@ get licenses(): (URL)[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19346,12 +21408,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19394,12 +21466,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19442,12 +21524,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19521,7 +21613,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19562,7 +21659,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19603,7 +21705,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19644,7 +21751,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19753,12 +21865,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19827,7 +21949,12 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19868,7 +21995,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19909,7 +22041,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19950,7 +22087,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19991,7 +22133,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20111,7 +22258,12 @@ get licenses(): (URL)[] { const decoded = await Source.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20157,7 +22309,12 @@ get licenses(): (URL)[] { const decoded = await DataIntegrityProof.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20189,7 +22346,12 @@ get licenses(): (URL)[] { const decoded = await InteractionPolicy.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20259,7 +22421,12 @@ get licenses(): (URL)[] { const decoded = await LikeAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20300,7 +22467,12 @@ get licenses(): (URL)[] { const decoded = await ReplyAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20341,7 +22513,12 @@ get licenses(): (URL)[] { const decoded = await AnnounceAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20373,7 +22550,12 @@ get licenses(): (URL)[] { const decoded = await Translation.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20427,6 +22609,16 @@ get licenses(): (URL)[] { } instance.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = _2rzkBRS4gNPrkJk9DohHAMUAxA2d; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Object.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -21451,6 +23643,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -21516,9 +23712,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -21706,6 +23903,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -21838,6 +24037,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Emoji)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -21845,6 +24047,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Emoji.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -22017,6 +24229,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -22130,9 +24346,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -22260,6 +24477,112 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ChatMessage).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ChatMessage).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#quoteUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ChatMessage).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ \\"@value\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ChatMessage).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); +descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); +descriptors.set(\\"http://fedibird.com/ns#quoteUri\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quoteAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ChatMessage).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ChatMessage).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchQuote( url: URL, @@ -22629,6 +24952,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -22641,6 +24965,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -23073,6 +25401,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -23085,6 +25414,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -23260,8 +25593,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -23280,6 +25618,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { \\"@value\\": formatIri(v) } ); @@ -23304,8 +25643,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -23390,6 +25734,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -23522,6 +25868,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ChatMessage)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -23553,7 +25902,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -23633,7 +25987,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -23650,6 +26009,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ChatMessage.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -24232,6 +26601,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -24705,9 +27078,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -24907,6 +27281,232 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#actor\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#actor\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#object\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#object\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#target\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#target\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#result\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#result\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#origin\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_25zu2s3VxVujgEKqrDycjE284XQR_origin) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_25zu2s3VxVujgEKqrDycjE284XQR_origin; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#origin\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#instrument\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#instrument\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchActor( url: URL, @@ -25336,6 +27936,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#actor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -25348,6 +27949,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -25500,6 +28105,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#actor_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -25512,6 +28118,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -25923,6 +28533,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#object_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -25935,6 +28546,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -26087,6 +28702,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#object_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -26099,6 +28715,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -26513,6 +29133,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#target_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -26525,6 +29146,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -26680,6 +29305,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#target_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -26692,6 +29318,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27103,6 +29733,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#result_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -27115,6 +29746,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27267,6 +29902,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#result_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -27279,6 +29915,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27691,6 +30331,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#origin_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -27703,6 +30344,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27856,6 +30501,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#origin_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -27868,6 +30514,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28278,6 +30928,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#instrument_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -28290,6 +30941,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28441,6 +31096,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#instrument_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -28453,6 +31109,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28544,8 +31204,29 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28564,8 +31245,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28584,8 +31270,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28604,8 +31295,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28624,8 +31320,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28644,8 +31345,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28730,6 +31436,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -29002,6 +31710,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Activity)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -29034,23 +31745,48 @@ const base = getDeepCloneDescriptor(this.prototype)!; typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -29091,7 +31827,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29132,7 +31873,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29173,7 +31919,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29214,7 +31965,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29255,7 +32011,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29272,6 +32033,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Activity.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -29556,6 +32327,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -29627,9 +32402,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -29804,6 +32580,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -29936,6 +32714,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof EmojiReact)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -29943,6 +32724,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + EmojiReact.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -30003,7 +32794,7 @@ instruments?: (Object | URL)[];} }; /** A pair of property name and value. */ -export class PropertyValue { +export class PropertyValue implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -30019,6 +32810,14 @@ export class PropertyValue { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -30164,6 +32963,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -30203,6 +33006,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if (\\"name\\" in values && values.name != null) { @@ -30248,9 +33052,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -30306,6 +33111,94 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: PropertyValue, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#name\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as PropertyValue).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as PropertyValue).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); + + descriptor = { + canonicalIri: \\"http://schema.org#value\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as PropertyValue).#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as PropertyValue).#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value; + }, + }; + descriptors.set(\\"http://schema.org#value\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The name of a property. */ @@ -30422,6 +33315,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -30445,6 +33339,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -30533,6 +33428,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://schema.org#value\\",\\"https://www.w3.org/ns/activitystreams#name\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -30734,6 +33631,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value = _2cSy2magg4iZ7zLaG8U7DiJMoCkx_value; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + PropertyValue.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -30849,7 +33756,7 @@ deepCloneDescriptors.set(this.prototype, { }; /** A quantity with a unit of measure. */ -export class Measure { +export class Measure implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -30865,6 +33772,14 @@ export class Measure { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -31010,6 +33925,10 @@ unit?: string | null;numericalValue?: Decimal | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -31049,6 +33968,7 @@ unit?: string | null;numericalValue?: Decimal | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.length < vocabSparseArrayMinimumLength ? this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.slice() : vocabCopyPropertyArray(this.#_27fgyFbosTtMAhuepJH8K3ZGURT6); if (\\"unit\\" in values && values.unit != null) { @@ -31094,9 +34014,10 @@ unit?: string | null;numericalValue?: Decimal | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -31152,6 +34073,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Measure, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Measure).#_27fgyFbosTtMAhuepJH8K3ZGURT6) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Measure).#_27fgyFbosTtMAhuepJH8K3ZGURT6; + }, + }; + descriptors.set(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Measure).#_1GQx8o2RgxRs4x9G5uT39XYBv7D) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#decimal\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Measure).#_1GQx8o2RgxRs4x9G5uT39XYBv7D; + }, + }; + descriptors.set(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The name of the unit, according to the Ontology of units of Measure * classification. The recommended unit for countable items is \`\\"one\\"\`. @@ -31266,6 +34272,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_27fgyFbosTtMAhuepJH8K3ZGURT6) { + let element = ( { \\"@value\\": v } ); @@ -31286,6 +34293,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#decimal\\", @@ -31364,6 +34372,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\",\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -31558,6 +34568,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = _1GQx8o2RgxRs4x9G5uT39XYBv7D; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Measure.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -31775,6 +34795,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -31874,9 +34898,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -31982,6 +35007,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as AnnounceAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as AnnounceAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as AnnounceAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as AnnounceAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -32350,6 +35449,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -32362,6 +35462,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -32770,6 +35874,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -32782,6 +35887,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -32931,8 +36040,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -32951,8 +36065,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -33037,6 +36156,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -33169,6 +36290,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof AnnounceAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -33200,7 +36324,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -33241,7 +36370,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -33258,6 +36392,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + AnnounceAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -33436,6 +36580,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -33507,9 +36655,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -33684,6 +36833,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -33816,6 +36967,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof AnnounceRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -33823,6 +36977,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + AnnounceRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -33890,7 +37054,7 @@ instruments?: (Object | URL)[];} * for details. * */ -export class InteractionPolicy { +export class InteractionPolicy implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -33906,6 +37070,14 @@ export class InteractionPolicy { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -34093,6 +37265,10 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -34132,6 +37308,7 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature = this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length < vocabSparseArrayMinimumLength ? this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.slice() : vocabCopyPropertyArray(this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature); if (\\"canFeature\\" in values && values.canFeature != null) { @@ -34219,9 +37396,10 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -34387,6 +37565,198 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: InteractionPolicy, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#canFeature\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#canFeature\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#canLike\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#canLike\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#canReply\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#canReply\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#canAnnounce\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#canAnnounce\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#canQuote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#canQuote\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The sub-policy specifying who can feature the actor in a * {@link FeaturedCollection}. @@ -34511,8 +37881,13 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34531,8 +37906,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34551,8 +37931,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34571,8 +37956,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34591,8 +37981,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34691,6 +38086,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://gotosocial.org/ns#canAnnounce\\",\\"https://gotosocial.org/ns#canLike\\",\\"https://gotosocial.org/ns#canQuote\\",\\"https://gotosocial.org/ns#canReply\\",\\"https://w3id.org/fep/7aa9#canFeature\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -34841,7 +38238,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34873,7 +38275,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34905,7 +38312,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34937,7 +38349,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34969,7 +38386,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34986,6 +38408,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote = _LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + InteractionPolicy.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -35179,7 +38611,7 @@ deepCloneDescriptors.set(this.prototype, { * for details. * */ -export class InteractionRule { +export class InteractionRule implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -35195,6 +38627,14 @@ export class InteractionRule { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -35436,6 +38876,10 @@ manualApprovals?: (URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -35477,6 +38921,7 @@ manualApprovals?: (URL)[];} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length < vocabSparseArrayMinimumLength ? this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.slice() : vocabCopyPropertyArray(this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval); if (\\"automaticApproval\\" in values && values.automaticApproval != null) { @@ -35616,9 +39061,10 @@ manualApprovals?: (URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -35720,6 +39166,88 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: InteractionRule, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#automaticApproval\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionRule).#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionRule).#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#automaticApproval\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#manualApproval\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionRule).#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionRule).#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#manualApproval\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** URIs of actors or collections whose interactions are automatically * approved without requiring manual review by the post author. @@ -35807,6 +39335,7 @@ get manualApprovals(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -35827,6 +39356,7 @@ get manualApprovals(): (URL)[] { array = []; for (const v of this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -35902,6 +39432,8 @@ get manualApprovals(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#manualApproval\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -36095,6 +39627,16 @@ get manualApprovals(): (URL)[] { } instance.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = _sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + InteractionRule.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -36323,6 +39865,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -36422,9 +39968,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -36530,6 +40077,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as LikeAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as LikeAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as LikeAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as LikeAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -36898,6 +40519,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -36910,6 +40532,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -37318,6 +40944,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -37330,6 +40957,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -37479,8 +41110,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -37499,8 +41135,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -37585,6 +41226,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -37717,6 +41360,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof LikeAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -37748,7 +41394,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -37789,7 +41440,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -37806,6 +41462,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + LikeAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -37983,6 +41649,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -38054,9 +41724,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -38231,6 +41902,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -38363,6 +42036,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof LikeRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -38370,6 +42046,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + LikeRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -38531,6 +42217,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -38630,9 +42320,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -38738,6 +42429,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ReplyAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ReplyAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ReplyAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ReplyAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -39106,6 +42871,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -39118,6 +42884,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -39526,6 +43296,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -39538,6 +43309,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -39687,8 +43462,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -39707,8 +43487,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -39793,6 +43578,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -39925,6 +43712,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ReplyAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -39956,7 +43746,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -39997,7 +43792,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -40014,6 +43814,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ReplyAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -40191,6 +44001,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -40262,9 +44076,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -40439,6 +44254,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -40571,6 +44388,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ReplyRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -40578,6 +44398,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ReplyRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -40739,6 +44569,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -40838,9 +44672,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -40946,6 +44781,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as QuoteAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as QuoteAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as QuoteAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as QuoteAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -41313,6 +45222,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -41325,6 +45235,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -41733,6 +45647,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -41745,6 +45660,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -41894,8 +45813,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -41914,8 +45838,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -42000,6 +45929,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -42132,6 +46063,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof QuoteAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -42163,7 +46097,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -42204,7 +46143,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -42221,6 +46165,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + QuoteAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -42398,6 +46352,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -42469,9 +46427,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -42646,6 +46605,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -42778,6 +46739,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof QuoteRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -42785,6 +46749,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + QuoteRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -42852,7 +46826,7 @@ instruments?: (Object | URL)[];} * Targets [draft revision 6d0d6559](https://codeberg.org/fediverse/fep/src/commit/6d0d6559054baeb7b71a5f2bdc14fc4c09b66f39/fep/22cd/fep-22cd.md). * */ -export class Translation { +export class Translation implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -42868,6 +46842,14 @@ export class Translation { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -43169,6 +47151,10 @@ urls?: ((URL | Link))[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -43210,6 +47196,7 @@ urls?: ((URL | Link))[];} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.length < vocabSparseArrayMinimumLength ? this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.slice() : vocabCopyPropertyArray(this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG); if (\\"language\\" in values && values.language != null) { @@ -43411,9 +47398,10 @@ urls?: ((URL | Link))[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -43559,6 +47547,235 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Translation, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://schema.org/inLanguage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_diXuPmFWiEqfLPhhrxg6Xc7ixZG) { + + let element = ( +{ \\"@value\\": v.baseName } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_diXuPmFWiEqfLPhhrxg6Xc7ixZG; + }, + }; + descriptors.set(\\"https://schema.org/inLanguage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://schema.org/translator\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; + }, + }; + descriptors.set(\\"https://schema.org/translator\\", descriptor); + + descriptor = { + canonicalIri: \\"https://schema.org/translationOfWork\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_Msz9PwRg7cWkiXPL4ixyQLtuuH7) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_Msz9PwRg7cWkiXPL4ixyQLtuuH7; + }, + }; + descriptors.set(\\"https://schema.org/translationOfWork\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/22cd#sourceUpdated\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated; + }, + }; + descriptors.set(\\"https://w3id.org/fep/22cd#sourceUpdated\\", descriptor); + + descriptor = { + canonicalIri: \\"https://schema.org/isBasedOn\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_4KvkQNz1JjGs8S7iJDcGrUYETbUW) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_4KvkQNz1JjGs8S7iJDcGrUYETbUW; + }, + }; + descriptors.set(\\"https://schema.org/isBasedOn\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#url\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + + let element = ( +v instanceof URL ?{ \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#url\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The translated language. Publishers must match a language in the * containing object's content, name, or summary map. @@ -44006,6 +48223,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#translator_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -44018,6 +48236,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -44173,6 +48395,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#translator_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -44185,6 +48408,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -44467,6 +48694,7 @@ get urls(): ((URL | Link))[] { const values: Record = {}; array = []; for (const v of this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG) { + let element = ( { \\"@value\\": v.baseName } ); @@ -44487,8 +48715,29 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -44507,6 +48756,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -44527,6 +48777,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -44550,6 +48801,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -44570,8 +48822,13 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + let element = ( - v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -44650,6 +48907,8 @@ get urls(): ((URL | Link))[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://schema.org/inLanguage\\",\\"https://schema.org/isBasedOn\\",\\"https://schema.org/translationOfWork\\",\\"https://schema.org/translator\\",\\"https://w3id.org/fep/22cd#sourceUpdated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -44839,23 +49098,48 @@ get urls(): ((URL | Link))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -44982,7 +49266,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -44999,6 +49288,16 @@ get urls(): ((URL | Link))[] { } instance.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = _2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Translation.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -45303,6 +49602,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -45402,9 +49705,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -45510,6 +49814,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactingObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeatureAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeatureAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://gotosocial.org/ns#interactionTarget\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeatureAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeatureAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -45876,6 +50254,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -45888,6 +50267,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -46295,6 +50678,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -46307,6 +50691,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -46456,8 +50844,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -46476,8 +50869,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -46562,6 +50960,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -46694,6 +51094,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeatureAuthorization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -46725,7 +51128,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -46766,7 +51174,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -46783,6 +51196,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeatureAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -46957,6 +51380,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -47028,9 +51455,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -47205,6 +51633,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -47337,6 +51767,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeatureRequest)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -47344,6 +51777,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeatureRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -47704,6 +52147,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -48015,9 +52462,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -48343,6 +52791,457 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#totalItems\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#totalItems\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#current\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_3UyUdxnyn6cDn53QKrh4MBiearma_current; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#current\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#first\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_J52RqweMe6hhv7RnLJMC8BExTE5_first; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#first\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#last\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#last\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#items\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#likesOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#likesOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#sharesOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#sharesOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#repliesOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#repliesOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#inboxOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#inboxOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#outboxOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#outboxOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#followersOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#followersOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#followingOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#followingOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/5711#likedOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; + }, + }; + descriptors.set(\\"https://w3id.org/fep/5711#likedOf\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A non-negative integer specifying the total number of objects contained by * the logical view of the collection. This number might not reflect the actual @@ -48727,6 +53626,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#current_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -48739,6 +53639,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -49148,6 +54052,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#first_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -49160,6 +54065,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -49569,6 +54478,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#last_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -49581,6 +54491,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -50009,6 +54923,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#item_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -50021,6 +54936,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -50430,6 +55349,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#likesOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -50442,6 +55362,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -50850,6 +55774,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#sharesOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -50862,6 +55787,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -51270,6 +56199,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#repliesOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -51282,6 +56212,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -51690,6 +56624,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inboxOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -51702,6 +56637,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -52110,6 +57049,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outboxOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -52122,6 +57062,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -52530,6 +57474,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followersOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -52542,6 +57487,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -52950,6 +57899,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followingOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -52962,6 +57912,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -53370,6 +58324,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#likedOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -53382,6 +58337,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -53751,6 +58710,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -53774,8 +58734,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53794,8 +58759,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53814,8 +58784,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53834,8 +58809,17 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53854,8 +58838,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53874,8 +58863,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53894,8 +58888,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53914,8 +58913,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53934,8 +58938,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53954,8 +58963,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53974,8 +58988,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53994,8 +59013,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -54080,6 +59104,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -54228,6 +59254,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Collection)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -54288,7 +59317,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54329,7 +59363,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54370,7 +59409,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54413,12 +59457,22 @@ const base = getDeepCloneDescriptor(this.prototype)!; && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -54459,7 +59513,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54500,7 +59559,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54541,7 +59605,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54582,7 +59651,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54623,7 +59697,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54664,7 +59743,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54705,7 +59789,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54746,7 +59835,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54763,6 +59857,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Collection.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -55192,6 +60296,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -55302,9 +60410,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -55388,6 +60497,50 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#items\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as OrderedCollection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as OrderedCollection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchItem( url: URL, @@ -55775,6 +60928,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#item_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -55787,6 +60941,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -55918,8 +61076,17 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -56004,6 +61171,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -56140,6 +61309,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof OrderedCollection)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -56173,12 +61345,22 @@ const base = getDeepCloneDescriptor(this.prototype)!; && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -56195,6 +61377,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + OrderedCollection.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -56369,6 +61561,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -56462,9 +61658,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -56548,6 +61745,76 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#topic\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedCollection).#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedCollection).#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#topic\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedCollection).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedCollection).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A single {@link Hashtag} object that represents the main topic or category * of this featured collection. @@ -56683,8 +61950,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -56703,6 +61975,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -56789,6 +62062,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/fep/7aa9#topic\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -56921,6 +62196,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeaturedCollection)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -56943,7 +62221,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Hashtag.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -56989,6 +62272,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = _gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeaturedCollection.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -57185,6 +62478,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -57284,9 +62581,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -57392,6 +62690,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredObject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedItem).#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedItem).#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredObject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featureAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedItem).#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedItem).#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featureAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchFeaturedObject( url: URL, @@ -57758,6 +63130,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -57770,6 +63143,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -58179,6 +63556,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featureAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -58191,6 +63569,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -58340,8 +63722,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -58360,8 +63747,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -58446,6 +63838,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/7aa9#featureAuthorization\\",\\"https://w3id.org/fep/7aa9#featuredObject\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -58578,6 +63972,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeaturedItem)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -58609,7 +64006,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -58650,7 +64052,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await FeatureAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -58667,6 +64074,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = _2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeaturedItem.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -58771,7 +64188,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; * and verifiable credential repository services. * */ -export class DidService { +export class DidService implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -58787,6 +64204,14 @@ export class DidService { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -58966,6 +64391,10 @@ endpoints?: (URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -59006,6 +64435,7 @@ endpoints?: (URL)[];} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length < vocabSparseArrayMinimumLength ? this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.slice() : vocabCopyPropertyArray(this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint); if (\\"endpoint\\" in values && values.endpoint != null) { @@ -59084,9 +64514,10 @@ endpoints?: (URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -59165,6 +64596,58 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: DidService, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#serviceEndpoint\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DidService).#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DidService).#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#serviceEndpoint\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A network address, such as an HTTP URL, at which services operate on behalf * of a DID subject. @@ -59227,6 +64710,7 @@ get endpoints(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -59302,6 +64786,8 @@ get endpoints(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://www.w3.org/ns/did#serviceEndpoint\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -59470,6 +64956,16 @@ get endpoints(): (URL)[] { } instance.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + DidService.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -59618,6 +65114,10 @@ endpoints?: (URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -59668,9 +65168,10 @@ endpoints?: (URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -59813,6 +65314,8 @@ endpoints?: (URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://www.w3.org/ns/did#serviceEndpoint\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -59945,6 +65448,9 @@ endpoints?: (URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Export)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -59952,6 +65458,16 @@ endpoints?: (URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Export.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -60014,7 +65530,7 @@ endpoints?: (URL)[];} * verify the identity of the actor and the integrity of the data. * */ -export class DataIntegrityProof { +export class DataIntegrityProof implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -60030,6 +65546,14 @@ export class DataIntegrityProof { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -60221,6 +65745,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -60260,6 +65788,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.length < vocabSparseArrayMinimumLength ? this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.slice() : vocabCopyPropertyArray(this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite); if (\\"cryptosuite\\" in values && values.cryptosuite != null) { @@ -60352,9 +65881,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -60454,6 +65984,190 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: DataIntegrityProof, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/security#cryptosuite\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite; + }, + }; + descriptors.set(\\"https://w3id.org/security#cryptosuite\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#verificationMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#verificationMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#proofPurpose\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose) { + + let element = ( +{ + \\"@id\\": \\"https://w3id.org/security#\\" + v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose; + }, + }; + descriptors.set(\\"https://w3id.org/security#proofPurpose\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#proofValue\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue) { + + let element = ( +{ + \\"@type\\": \\"https://w3id.org/security#multibase\\", + \\"@value\\": new TextDecoder().decode(encodeMultibase(\\"base58btc\\", v)), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue; + }, + }; + descriptors.set(\\"https://w3id.org/security#proofValue\\", descriptor); + + descriptor = { + canonicalIri: \\"http://purl.org/dc/terms/created\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_3qzP3ukEZoUziK5FEiA1RhU4aqac) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_3qzP3ukEZoUziK5FEiA1RhU4aqac; + }, + }; + descriptors.set(\\"http://purl.org/dc/terms/created\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The cryptographic suite used to create the proof. * @@ -60942,6 +66656,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite) { + let element = ( { \\"@value\\": v } ); @@ -60962,8 +66677,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -60982,6 +66702,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose) { + let element = ( { \\"@id\\": \\"https://w3id.org/security#\\" + v, @@ -61004,6 +66725,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue) { + let element = ( { \\"@type\\": \\"https://w3id.org/security#multibase\\", @@ -61027,6 +66749,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -61105,6 +66828,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://purl.org/dc/terms/created\\",\\"https://w3id.org/security#cryptosuite\\",\\"https://w3id.org/security#proofPurpose\\",\\"https://w3id.org/security#proofValue\\",\\"https://w3id.org/security#verificationMethod\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -61293,7 +67018,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -61401,6 +67131,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = _3qzP3ukEZoUziK5FEiA1RhU4aqac; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + DataIntegrityProof.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -61576,7 +67316,7 @@ deepCloneDescriptors.set(this.prototype, { }; /** A key owned by an actor. */ -export class CryptographicKey { +export class CryptographicKey implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -61592,6 +67332,14 @@ export class CryptographicKey { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -61742,6 +67490,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -61781,6 +67533,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < vocabSparseArrayMinimumLength ? this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.slice() : vocabCopyPropertyArray(this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner);clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = vocabCopyTrustSet( this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, @@ -61832,9 +67585,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -61912,6 +67666,108 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: CryptographicKey, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/security#owner\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CryptographicKey).#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CryptographicKey).#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner; + }, + }; + descriptors.set(\\"https://w3id.org/security#owner\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKeyPem\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CryptographicKey).#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem) { + + let element = ( +{ \\"@value\\": await exportSpki(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CryptographicKey).#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKeyPem\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchOwner( url: URL, @@ -62338,6 +68194,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#owner_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -62350,6 +68207,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -62508,8 +68369,29 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -62528,6 +68410,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem) { + let element = ( { \\"@value\\": await exportSpki(v) } ); @@ -62603,6 +68486,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#publicKeyPem\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -62763,23 +68648,48 @@ deepCloneDescriptors.set(this.prototype, { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -62825,6 +68735,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = _2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + CryptographicKey.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -62944,7 +68864,7 @@ deepCloneDescriptors.set(this.prototype, { * [1]: https://w3id.org/fep/521a * */ -export class Multikey { +export class Multikey implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -62960,6 +68880,14 @@ export class Multikey { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -63110,6 +69038,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -63149,6 +69081,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < vocabSparseArrayMinimumLength ? this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.slice() : vocabCopyPropertyArray(this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller);clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = vocabCopyTrustSet( this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, @@ -63200,9 +69133,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -63280,6 +69214,111 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Multikey, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/security#controller\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Multikey).#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Multikey).#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller; + }, + }; + descriptors.set(\\"https://w3id.org/security#controller\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKeyMultibase\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Multikey).#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase) { + + let element = ( +{ + \\"@type\\": \\"https://w3id.org/security#multibase\\", + \\"@value\\": await exportMultibaseKey(v), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Multikey).#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKeyMultibase\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchController( url: URL, @@ -63706,6 +69745,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#controller_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -63718,6 +69758,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -63880,8 +69924,29 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -63900,6 +69965,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase) { + let element = ( { \\"@type\\": \\"https://w3id.org/security#multibase\\", @@ -63978,6 +70044,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#publicKeyMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -64138,23 +70206,48 @@ deepCloneDescriptors.set(this.prototype, { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -64200,6 +70293,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase = _4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Multikey.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -64416,6 +70519,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -64509,9 +70616,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -64617,6 +70725,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#stipulates\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Agreement).#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Agreement).#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#stipulates\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#stipulatesReciprocal\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Agreement).#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Agreement).#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#stipulatesReciprocal\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The primary {@link Commitment} associated with the agreement. This * commitment satisfies the primary {@link Intent} of the corresponding @@ -64757,8 +70939,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -64777,8 +70964,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -64863,6 +71055,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/valueflows/ont/vf#stipulates\\",\\"https://w3id.org/valueflows/ont/vf#stipulatesReciprocal\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -64995,6 +71189,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Agreement)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -65017,7 +71214,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Commitment.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -65049,7 +71251,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Commitment.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -65066,6 +71273,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal = _4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Agreement.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -65170,7 +71387,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; * specifies the actual amount of the economic resource being committed. * */ -export class Commitment { +export class Commitment implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -65186,6 +71403,14 @@ export class Commitment { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -65331,6 +71556,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -65370,6 +71599,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies = this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length < vocabSparseArrayMinimumLength ? this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.slice() : vocabCopyPropertyArray(this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies); if (\\"satisfies\\" in values && values.satisfies != null) { @@ -65415,9 +71645,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -65517,6 +71748,92 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Commitment, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#satisfies\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Commitment).#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Commitment).#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#satisfies\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Commitment).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Commitment).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The {@link Intent} of a {@link Proposal} that this commitment * satisfies. The value is the proposal's URI with a @@ -65639,6 +71956,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -65659,8 +71977,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -65734,6 +72057,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -65913,7 +72238,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -65930,6 +72260,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Commitment.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -66047,7 +72387,7 @@ deepCloneDescriptors.set(this.prototype, { * in a {@link Proposal}. * */ -export class Intent { +export class Intent implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -66063,6 +72403,14 @@ export class Intent { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -66250,6 +72598,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -66289,6 +72641,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length < vocabSparseArrayMinimumLength ? this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.slice() : vocabCopyPropertyArray(this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action); if (\\"action\\" in values && values.action != null) { @@ -66376,9 +72729,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -66522,6 +72876,190 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Intent, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#action\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#action\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#availableQuantity\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#availableQuantity\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The type of economic transaction. The value of this property should be * either \`\\"deliverService\\"\` or \`\\"transfer\\"\`. @@ -66737,6 +73275,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) { + let element = ( { \\"@value\\": v } ); @@ -66757,6 +73296,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -66777,8 +73317,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -66797,8 +73342,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -66817,8 +73367,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -66892,6 +73447,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://w3id.org/valueflows/ont/vf#action\\",\\"https://w3id.org/valueflows/ont/vf#availableQuantity\\",\\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -67101,7 +73658,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -67133,7 +73695,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -67165,7 +73732,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -67182,6 +73754,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Intent.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -67486,6 +74068,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -67607,9 +74193,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -67715,6 +74302,140 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#purpose\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#purpose\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#publishes\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#publishes\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#reciprocal\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#reciprocal\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/valueflows/ont/vf#unitBased\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased; + }, + }; + descriptors.set(\\"https://w3id.org/valueflows/ont/vf#unitBased\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The type of proposal. Possible values are \`\\"offer\\"\` and \`\\"request\\"\`. * @@ -67914,6 +74635,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) { + let element = ( { \\"@value\\": v } ); @@ -67934,8 +74656,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -67954,8 +74681,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -67974,6 +74706,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) { + let element = ( { \\"@value\\": v } ); @@ -68060,6 +74793,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/valueflows/ont/vf#publishes\\",\\"https://w3id.org/valueflows/ont/vf#purpose\\",\\"https://w3id.org/valueflows/ont/vf#reciprocal\\",\\"https://w3id.org/valueflows/ont/vf#unitBased\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -68192,6 +74927,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Proposal)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -68244,7 +74982,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -68276,7 +75019,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -68322,6 +75070,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Proposal.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -68532,6 +75290,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -68603,9 +75365,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -68780,6 +75543,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -68916,6 +75681,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Accept)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -68923,6 +75691,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Accept.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -69054,6 +75832,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -69125,9 +75907,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -69302,6 +76085,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -69434,6 +76219,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Add)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -69441,6 +76229,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Add.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -69571,6 +76369,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -69642,9 +76444,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -69819,6 +76622,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -69951,6 +76756,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Announce)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -69958,6 +76766,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Announce.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -70821,6 +77639,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -71646,9 +78468,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -72090,6 +78913,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -72479,6 +80161,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -72491,6 +80174,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -72640,6 +80327,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -72652,6 +80340,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -73064,6 +80756,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -73076,6 +80769,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -73229,6 +80926,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -73241,6 +80939,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -73723,6 +81425,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -73735,6 +81438,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -74167,6 +81874,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -74179,6 +81887,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -74591,6 +82303,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -74603,6 +82316,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -75018,6 +82735,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -75030,6 +82748,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -75443,6 +83165,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -75455,6 +83178,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -75866,6 +83593,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -75878,6 +83606,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -76289,6 +84021,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -76301,6 +84034,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -76709,6 +84446,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -76721,6 +84459,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -77133,6 +84875,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -77145,6 +84888,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -77699,6 +85446,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -77711,6 +85459,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -78182,6 +85934,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -78194,6 +85947,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -78347,6 +86104,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -78359,6 +86117,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -78771,6 +86533,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -78783,6 +86546,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -78936,6 +86703,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -78948,6 +86716,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -79624,6 +87396,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -79647,8 +87420,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79667,8 +87445,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79687,6 +87470,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -79707,6 +87491,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -79727,8 +87512,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79747,8 +87541,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79767,8 +87570,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79787,8 +87595,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79807,8 +87620,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79827,8 +87645,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79847,8 +87670,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79867,8 +87695,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79887,8 +87720,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79907,8 +87745,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79927,6 +87770,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -79947,6 +87791,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -79967,6 +87812,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -79987,6 +87833,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -80027,8 +87874,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -80047,8 +87915,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -80067,8 +87956,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -80087,6 +87981,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -80107,6 +88002,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -80127,6 +88023,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -80228,6 +88125,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -80360,6 +88259,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Application)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -80424,7 +88326,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80465,7 +88372,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80566,11 +88478,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -80613,11 +88535,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -80658,7 +88590,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80699,7 +88636,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80740,7 +88682,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80781,7 +88728,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80822,7 +88774,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80863,7 +88820,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80904,7 +88866,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80936,7 +88903,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -81124,23 +89096,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -81182,23 +89179,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -81239,7 +89261,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -81344,6 +89371,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Application.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -82034,6 +90071,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -82105,9 +90146,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -82282,6 +90324,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -82426,6 +90470,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof IntransitiveActivity)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -82433,6 +90480,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + IntransitiveActivity.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -82563,6 +90620,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -82634,9 +90695,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -82811,6 +90873,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -82943,6 +91007,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Arrive)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -82950,6 +91017,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Arrive.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -83117,6 +91194,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -83230,9 +91311,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -83360,6 +91442,112 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Article).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Article).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#quoteUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Article).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ \\"@value\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Article).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); +descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); +descriptors.set(\\"http://fedibird.com/ns#quoteUri\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quoteAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Article).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Article).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchQuote( url: URL, @@ -83729,6 +91917,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -83741,6 +91930,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84173,6 +92366,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -84185,6 +92379,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84360,8 +92558,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -84380,6 +92583,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { \\"@value\\": formatIri(v) } ); @@ -84404,8 +92608,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -84490,6 +92699,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -84622,6 +92833,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Article)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -84653,7 +92867,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -84733,7 +92952,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -84750,6 +92974,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Article.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -84973,6 +93207,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -85080,9 +93318,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -85136,6 +93375,108 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; return deepCloneGraph(this, this.clone(values, cloneOptions)); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#width\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Document).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Document).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#width\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#height\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Document).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Document).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#height\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Document).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Document).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** Specifies a hint as to the rendering width in * device-independent pixels of the linked resource. @@ -85299,6 +93640,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -85322,6 +93664,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -85345,6 +93688,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + let element = ( { \\"@value\\": v } ); @@ -85431,6 +93775,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -85579,6 +93925,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Document)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -85674,6 +94023,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } instance.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Document.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -85855,6 +94214,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -85920,9 +94283,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -86110,6 +94474,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -86242,6 +94608,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Audio)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -86249,6 +94618,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Audio.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -86378,6 +94757,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -86449,9 +94832,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -86626,6 +95010,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -86762,6 +95148,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Ignore)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -86769,6 +95158,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Ignore.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -86900,6 +95299,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -86971,9 +95374,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -87148,6 +95552,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -87280,6 +95686,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Block)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -87287,6 +95696,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Block.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -87459,6 +95878,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -87575,9 +95998,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -87705,6 +96129,114 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#partOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CollectionPage).#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CollectionPage).#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#partOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#next\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CollectionPage).#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CollectionPage).#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#next\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#prev\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CollectionPage).#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CollectionPage).#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#prev\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchPartOf( url: URL, @@ -88073,6 +96605,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#partOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -88085,6 +96618,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -88492,6 +97029,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#next_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -88504,6 +97042,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -88912,6 +97454,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#prev_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -88924,6 +97467,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -89093,8 +97640,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -89113,8 +97665,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -89133,8 +97690,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -89219,6 +97781,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -89355,6 +97919,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof CollectionPage)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -89386,7 +97953,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -89427,7 +97999,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -89468,7 +98045,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -89485,6 +98067,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + CollectionPage.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -89672,6 +98264,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -89743,9 +98339,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -89920,6 +98517,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -90052,6 +98651,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Create)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -90059,6 +98661,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Create.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -90188,6 +98800,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -90259,9 +98875,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -90436,6 +99053,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -90568,6 +99187,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Delete)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -90575,6 +99197,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Delete.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -90702,6 +99334,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -90773,9 +99409,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -90950,6 +99587,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -91082,6 +99721,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Dislike)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -91089,6 +99731,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Dislike.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -91149,7 +99801,7 @@ instruments?: (Object | URL)[];} }; /** Contents of {@link Actor}'s \`endpoints\`. */ -export class Endpoints { +export class Endpoints implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -91165,6 +99817,14 @@ export class Endpoints { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -91380,6 +100040,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -91419,6 +100083,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length < vocabSparseArrayMinimumLength ? this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.slice() : vocabCopyPropertyArray(this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl); if (\\"proxyUrl\\" in values && values.proxyUrl != null) { @@ -91534,9 +100199,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -91746,6 +100412,238 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Endpoints, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#proxyUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#proxyUrl\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#provideClientKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#provideClientKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#signClientKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#signClientKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#sharedInbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#sharedInbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#uploadMedia\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#uploadMedia\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** Endpoint URI so this actor's clients may access remote ActivityStreams * objects which require authentication to access. To use this endpoint, @@ -92036,6 +100934,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92056,6 +100955,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92076,6 +100976,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92096,6 +100997,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92116,6 +101018,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92136,6 +101039,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92156,6 +101060,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -92231,6 +101136,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#uploadMedia\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -92569,6 +101476,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia = _KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Endpoints.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -92845,6 +101762,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -92910,9 +101831,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -93100,6 +102022,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -93232,6 +102156,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Event)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -93239,6 +102166,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Event.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -93369,6 +102306,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -93440,9 +102381,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -93617,6 +102559,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -93749,6 +102693,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Flag)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -93756,6 +102703,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Flag.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -93887,6 +102844,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -93958,9 +102919,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -94135,6 +103097,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -94267,6 +103231,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Follow)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -94274,6 +103241,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Follow.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -95137,6 +104114,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -95962,9 +104943,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -96406,6 +105388,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -96795,6 +106636,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -96807,6 +106649,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -96956,6 +106802,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -96968,6 +106815,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -97380,6 +107231,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -97392,6 +107244,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -97545,6 +107401,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -97557,6 +107414,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -98039,6 +107900,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -98051,6 +107913,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -98483,6 +108349,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -98495,6 +108362,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -98907,6 +108778,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -98919,6 +108791,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -99334,6 +109210,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -99346,6 +109223,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -99759,6 +109640,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -99771,6 +109653,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -100182,6 +110068,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -100194,6 +110081,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -100605,6 +110496,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -100617,6 +110509,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -101025,6 +110921,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -101037,6 +110934,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -101449,6 +111350,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -101461,6 +111363,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -102015,6 +111921,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -102027,6 +111934,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -102498,6 +112409,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -102510,6 +112422,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -102663,6 +112579,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -102675,6 +112592,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -103087,6 +113008,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -103099,6 +113021,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -103252,6 +113178,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -103264,6 +113191,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -103940,6 +113871,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -103963,8 +113895,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -103983,8 +113920,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104003,6 +113945,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -104023,6 +113966,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -104043,8 +113987,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104063,8 +114016,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104083,8 +114045,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104103,8 +114070,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104123,8 +114095,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104143,8 +114120,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104163,8 +114145,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104183,8 +114170,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104203,8 +114195,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104223,8 +114220,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104243,6 +114245,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -104263,6 +114266,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -104283,6 +114287,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -104303,6 +114308,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -104343,8 +114349,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104363,8 +114390,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104383,8 +114431,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104403,6 +114456,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -104423,6 +114477,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -104443,6 +114498,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -104544,6 +114600,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -104676,6 +114734,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Group)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -104740,7 +114801,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -104781,7 +114847,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -104882,11 +114953,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -104929,11 +115010,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -104974,7 +115065,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105015,7 +115111,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105056,7 +115157,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105097,7 +115203,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105138,7 +115249,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105179,7 +115295,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105220,7 +115341,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105252,7 +115378,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105440,23 +115571,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -105498,23 +115654,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -105555,7 +115736,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105660,6 +115846,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Group.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -106288,7 +116484,7 @@ get attributionDomains(): (string)[] { * the resource. * */ -export class Link { +export class Link implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -106304,6 +116500,14 @@ export class Link { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -106713,6 +116917,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -106754,6 +116962,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length < vocabSparseArrayMinimumLength ? this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.slice() : vocabCopyPropertyArray(this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href); if (\\"href\\" in values && values.href != null) { @@ -107062,9 +117271,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -107188,6 +117398,347 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Link, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#href\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#href\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#rel\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#rel\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#mediaType\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#name\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#hreflang\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang) { + + let element = ( +{ \\"@value\\": v.baseName } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#hreflang\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#height\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#height\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#width\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#width\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preview\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Link ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preview\\", descriptor); + + descriptor = { + canonicalIri: \\"http://purl.org/dc/terms/license\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + }, + }; + descriptors.set(\\"http://purl.org/dc/terms/license\\", descriptor); +descriptors.set(\\"https://schema.org/license\\", descriptor); +descriptors.set(\\"http://creativecommons.org/ns#license\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The target resource pointed to by a {@link Link}. */ @@ -107718,6 +118269,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#preview_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -107730,6 +118282,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -108013,6 +118569,7 @@ get licenses(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -108033,6 +118590,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel) { + let element = ( { \\"@value\\": v } ); @@ -108053,6 +118611,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + let element = ( { \\"@value\\": v } ); @@ -108073,6 +118632,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + let element = ( { \\"@value\\": v } ); @@ -108093,6 +118653,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -108116,6 +118677,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang) { + let element = ( { \\"@value\\": v.baseName } ); @@ -108136,6 +118698,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -108159,6 +118722,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -108182,8 +118746,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -108202,6 +118775,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -108287,6 +118861,8 @@ get licenses(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://purl.org/dc/terms/license\\",\\"https://schema.org/license\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#hreflang\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#rel\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -108695,12 +119271,22 @@ get licenses(): (URL)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -108754,6 +119340,16 @@ get licenses(): (URL)[] { } instance.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = _2rzkBRS4gNPrkJk9DohHAMUAxA2d; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Link.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -109095,6 +119691,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -109146,9 +119746,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -109311,6 +119912,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://purl.org/dc/terms/license\\",\\"https://schema.org/license\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#hreflang\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#rel\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -109443,6 +120046,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Hashtag)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -109450,6 +120056,16 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Hashtag.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -109571,6 +120187,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -109636,9 +120256,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -109826,6 +120447,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -109958,6 +120581,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Image)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -109965,6 +120591,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Image.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -110095,6 +120731,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -110166,9 +120806,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -110343,6 +120984,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -110479,6 +121122,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Offer)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -110486,6 +121132,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Offer.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -110615,6 +121271,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -110686,9 +121346,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -110863,6 +121524,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -110995,6 +121658,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Invite)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -111002,6 +121668,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Invite.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -111131,6 +121807,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -111202,9 +121882,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -111379,6 +122060,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -111511,6 +122194,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Join)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -111518,6 +122204,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Join.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -111647,6 +122343,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -111718,9 +122418,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -111895,6 +122596,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -112027,6 +122730,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Leave)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -112034,6 +122740,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Leave.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -112163,6 +122879,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -112234,9 +122954,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -112411,6 +123132,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -112543,6 +123266,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Like)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -112550,6 +123276,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Like.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -112677,6 +123413,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -112748,9 +123488,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -112925,6 +123666,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -113057,6 +123800,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Listen)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -113064,6 +123810,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Listen.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -113171,6 +123927,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -113222,9 +123982,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -113387,6 +124148,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://purl.org/dc/terms/license\\",\\"https://schema.org/license\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#hreflang\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#rel\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -113519,6 +124282,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Mention)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -113526,6 +124292,16 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Mention.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -113656,6 +124432,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -113727,9 +124507,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -113904,6 +124685,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -114036,6 +124819,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Move)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -114043,6 +124829,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Move.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -114212,6 +125008,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -114325,9 +125125,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -114455,6 +125256,112 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Note).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Note).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#quoteUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Note).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ \\"@value\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Note).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); +descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); +descriptors.set(\\"http://fedibird.com/ns#quoteUri\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quoteAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Note).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Note).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchQuote( url: URL, @@ -114824,6 +125731,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -114836,6 +125744,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -115268,6 +126180,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -115280,6 +126193,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -115455,8 +126372,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -115475,6 +126397,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { \\"@value\\": formatIri(v) } ); @@ -115499,8 +126422,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -115585,6 +126513,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -115717,6 +126647,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Note)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -115748,7 +126681,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -115828,7 +126766,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -115845,6 +126788,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Note.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -116087,6 +127040,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -116211,9 +127168,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -116297,6 +127255,83 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#items\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as OrderedCollectionPage).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as OrderedCollectionPage).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#startIndex\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as OrderedCollectionPage).#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as OrderedCollectionPage).#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#startIndex\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchItem( url: URL, @@ -116684,6 +127719,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#item_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -116696,6 +127732,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -116858,8 +127898,17 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -116878,6 +127927,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -116967,6 +128017,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startIndex\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#totalItems\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -117099,6 +128151,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof OrderedCollectionPage)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -117132,12 +128187,22 @@ const base = getDeepCloneDescriptor(this.prototype)!; && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/fep/7aa9#FeatureAuthorization\\",\\"https://w3id.org/fep/7aa9#FeaturedItem\\",\\"https://w3id.org/valueflows/ont/vf#Agreement\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://w3id.org/fep/7aa9#FeatureRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -117183,6 +128248,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex = _2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + OrderedCollectionPage.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -118088,6 +129163,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -118913,9 +129992,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -119357,6 +130437,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -119746,6 +131685,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -119758,6 +131698,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -119907,6 +131851,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -119919,6 +131864,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -120331,6 +132280,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -120343,6 +132293,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -120496,6 +132450,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -120508,6 +132463,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -120990,6 +132949,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -121002,6 +132962,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -121434,6 +133398,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -121446,6 +133411,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -121858,6 +133827,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -121870,6 +133840,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -122285,6 +134259,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -122297,6 +134272,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -122710,6 +134689,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -122722,6 +134702,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -123133,6 +135117,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -123145,6 +135130,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -123556,6 +135545,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -123568,6 +135558,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -123976,6 +135970,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -123988,6 +135983,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -124400,6 +136399,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -124412,6 +136412,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -124966,6 +136970,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -124978,6 +136983,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -125449,6 +137458,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -125461,6 +137471,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -125614,6 +137628,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -125626,6 +137641,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -126038,6 +138057,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -126050,6 +138070,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -126203,6 +138227,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -126215,6 +138240,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -126891,6 +138920,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -126914,8 +138944,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -126934,8 +138969,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -126954,6 +138994,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -126974,6 +139015,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -126994,8 +139036,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127014,8 +139065,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127034,8 +139094,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127054,8 +139119,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127074,8 +139144,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127094,8 +139169,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127114,8 +139194,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127134,8 +139219,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127154,8 +139244,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127174,8 +139269,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127194,6 +139294,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -127214,6 +139315,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -127234,6 +139336,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -127254,6 +139357,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -127294,8 +139398,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127314,8 +139439,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127334,8 +139480,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127354,6 +139505,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -127374,6 +139526,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -127394,6 +139547,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -127495,6 +139649,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -127627,6 +139783,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Organization)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -127691,7 +139850,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -127732,7 +139896,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -127833,11 +140002,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -127880,11 +140059,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -127925,7 +140114,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -127966,7 +140160,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128007,7 +140206,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128048,7 +140252,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128089,7 +140298,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128130,7 +140344,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128171,7 +140390,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128203,7 +140427,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128391,23 +140620,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -128449,23 +140703,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -128506,7 +140785,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128611,6 +140895,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Organization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -129292,6 +141586,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -129357,9 +141655,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -129547,6 +141846,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -129679,6 +141980,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Page)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -129686,6 +141990,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Page.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -130549,6 +142863,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -131374,9 +143692,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -131818,6 +144137,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -132207,6 +145385,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -132219,6 +145398,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132368,6 +145551,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -132380,6 +145564,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132792,6 +145980,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -132804,6 +145993,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132957,6 +146150,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -132969,6 +146163,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133451,6 +146649,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -133463,6 +146662,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133895,6 +147098,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -133907,6 +147111,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -134319,6 +147527,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -134331,6 +147540,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -134746,6 +147959,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -134758,6 +147972,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -135171,6 +148389,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -135183,6 +148402,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -135594,6 +148817,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -135606,6 +148830,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136017,6 +149245,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -136029,6 +149258,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136437,6 +149670,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -136449,6 +149683,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136861,6 +150099,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -136873,6 +150112,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137427,6 +150670,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -137439,6 +150683,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137910,6 +151158,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -137922,6 +151171,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138075,6 +151328,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -138087,6 +151341,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138499,6 +151757,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -138511,6 +151770,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138664,6 +151927,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -138676,6 +151940,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -139352,6 +152620,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -139375,8 +152644,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139395,8 +152669,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139415,6 +152694,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -139435,6 +152715,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -139455,8 +152736,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139475,8 +152765,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139495,8 +152794,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139515,8 +152819,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139535,8 +152844,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139555,8 +152869,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139575,8 +152894,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139595,8 +152919,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139615,8 +152944,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139635,8 +152969,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139655,6 +152994,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -139675,6 +153015,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -139695,6 +153036,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -139715,6 +153057,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -139755,8 +153098,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139775,8 +153139,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139795,8 +153180,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139815,6 +153205,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -139835,6 +153226,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -139855,6 +153247,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -139956,6 +153349,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -140088,6 +153483,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Person)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -140152,7 +153550,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140193,7 +153596,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140294,11 +153702,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140341,11 +153759,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140386,7 +153814,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140427,7 +153860,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140468,7 +153906,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140509,7 +153952,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140550,7 +153998,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140591,7 +154044,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140632,7 +154090,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140664,7 +154127,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140852,23 +154320,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140910,23 +154403,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140967,7 +154485,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -141072,6 +154595,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Person.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -141840,6 +155373,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -141989,9 +155526,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -142075,6 +155613,207 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#accuracy\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#accuracy\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#altitude\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#altitude\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#latitude\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#latitude\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#longitude\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#longitude\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#radius\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#radius\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#units\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { + + let element = ( +v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ?{ \\"@value\\": v } :{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#units\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** Indicates the accuracy of position coordinates on a {@link Place} objects. * Expressed in properties of percentage. e.g. \\"94.0\\" means \\"94.0% accurate\\". @@ -142329,6 +156068,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142352,6 +156092,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142375,6 +156116,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142398,6 +156140,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142421,6 +156164,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#float\\", @@ -142444,6 +156188,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { + let element = ( v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? { \\"@value\\": v } : { \\"@id\\": formatIri(v) } ); @@ -142530,6 +156275,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#accuracy\\",\\"https://www.w3.org/ns/activitystreams#altitude\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#latitude\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#longitude\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#radius\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -142662,6 +156409,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Place)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -142846,6 +156596,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units = _oKrwxU4V8wiKhMW1QEYQibcJh8c_units; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Place.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -143108,6 +156868,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -143190,9 +156954,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -143276,6 +157041,46 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#describes\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Profile).#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Profile).#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#describes\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchDescribes( url: URL, @@ -143644,6 +157449,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#describes_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -143656,6 +157462,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -143785,8 +157595,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -143871,6 +157686,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -144003,6 +157820,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Profile)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -144034,7 +157854,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -144051,6 +157876,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Profile.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -144368,6 +158203,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -144605,9 +158444,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -144785,6 +158625,246 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#oneOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#oneOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#anyOf\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#anyOf\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#closed\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed) { + + let element = ( +isTemporalInstant(v) ?{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } :{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#closed\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#votersCount\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", + \\"@value\\": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#votersCount\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quote\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#quoteUrl\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ \\"@value\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); +descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); +descriptors.set(\\"http://fedibird.com/ns#quoteUri\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/044f#quoteAuthorization\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchExclusiveOption( url: URL, @@ -145158,6 +159238,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#exclusiveOption_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -145170,6 +159251,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -145585,6 +159670,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#inclusiveOption_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -145597,6 +159683,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146038,6 +160128,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -146050,6 +160141,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146482,6 +160577,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -146494,6 +160590,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146584,8 +160684,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146604,8 +160709,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146624,6 +160734,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed) { + let element = ( isTemporalInstant(v) ? { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", @@ -146647,6 +160758,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount) { + let element = ( { \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\", @@ -146670,8 +160782,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146690,6 +160807,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { \\"@value\\": formatIri(v) } ); @@ -146714,8 +160832,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146800,6 +160923,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#votersCount\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#closed\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -146932,6 +161057,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Question)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -146963,7 +161091,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147004,7 +161137,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147113,7 +161251,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147193,7 +161336,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147210,6 +161358,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Question.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -147482,6 +161640,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -147553,9 +161715,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -147730,6 +161893,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -147862,6 +162027,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Read)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -147869,6 +162037,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Read.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -147998,6 +162176,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -148069,9 +162251,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -148246,6 +162429,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -148382,6 +162567,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Reject)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -148389,6 +162577,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Reject.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -148665,6 +162863,10 @@ relationships?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -148883,9 +163085,10 @@ relationships?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -149015,6 +163218,114 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#subject\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Relationship).#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Relationship).#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#subject\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#object\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Relationship).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Relationship).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#object\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#relationship\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Relationship).#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Relationship).#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#relationship\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchSubject( url: URL, @@ -149385,6 +163696,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#subject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -149397,6 +163709,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -149805,6 +164121,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#object_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -149817,6 +164134,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -149967,6 +164288,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#object_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -149979,6 +164301,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150390,6 +164716,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#relationship_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -150402,6 +164729,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150554,6 +164885,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#relationship_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -150566,6 +164898,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150736,8 +165072,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -150756,8 +165097,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -150776,8 +165122,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -150862,6 +165213,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -150994,6 +165347,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Relationship)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -151025,7 +165381,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -151066,7 +165427,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -151107,7 +165473,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -151124,6 +165495,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Relationship.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -151325,6 +165706,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -151396,9 +165781,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -151573,6 +165959,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -151705,6 +166093,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Remove)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -151712,6 +166103,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Remove.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -152575,6 +166976,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -153400,9 +167805,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -153844,6 +168250,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#preferredUsername\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#publicKey\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/security#assertionMethod\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/ef61/gateways\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ \\"@id\\": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { \\"@list\\": array }; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); + + descriptor = { + canonicalIri: \\"http://www.w3.org/ns/ldp#inbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#outbox\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#following\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#followers\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#liked\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featured\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#featuredTags\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/7aa9#featuredCollections\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#streams\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#endpoints\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#discoverable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#suspended\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#memorial\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); + + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#indexable\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/did#service\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { \\"@id\\": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#_misskey_followedMessage\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); + + descriptor = { + canonicalIri: \\"https://misskey-hub.net/ns#isCat\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); + + descriptor = { + canonicalIri: \\"https://w3id.org/fep/6757#preferredLicense\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ \\"@id\\": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -154233,6 +169498,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -154245,6 +169511,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -154394,6 +169664,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -154406,6 +169677,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -154818,6 +170093,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -154830,6 +170106,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -154983,6 +170263,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -154995,6 +170276,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -155477,6 +170762,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -155489,6 +170775,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -155921,6 +171211,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -155933,6 +171224,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -156345,6 +171640,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -156357,6 +171653,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -156772,6 +172072,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -156784,6 +172085,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -157197,6 +172502,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -157209,6 +172515,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -157620,6 +172930,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -157632,6 +172943,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -158043,6 +173358,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -158055,6 +173371,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -158463,6 +173783,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -158475,6 +173796,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -158887,6 +174212,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -158899,6 +174225,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -159453,6 +174783,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -159465,6 +174796,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -159936,6 +175271,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -159948,6 +175284,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160101,6 +175441,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -160113,6 +175454,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160525,6 +175870,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -160537,6 +175883,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160690,6 +176040,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -160702,6 +176053,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -161378,6 +176733,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -161401,8 +176757,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161421,8 +176782,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161441,6 +176807,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { \\"@id\\": v.origin } ); @@ -161461,6 +176828,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { \\"@value\\": v } ); @@ -161481,8 +176849,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161501,8 +176878,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161521,8 +176907,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161541,8 +176932,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161561,8 +176957,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161581,8 +176982,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161601,8 +177007,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161621,8 +177032,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161641,8 +177057,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161661,8 +177082,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161681,6 +177107,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { \\"@value\\": v } ); @@ -161701,6 +177128,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { \\"@value\\": v } ); @@ -161721,6 +177149,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { \\"@value\\": v } ); @@ -161741,6 +177170,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { \\"@value\\": v } ); @@ -161781,8 +177211,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161801,8 +177252,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161821,8 +177293,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { \\"@id\\": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161841,6 +177318,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { \\"@value\\": v } ); @@ -161861,6 +177339,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { \\"@value\\": v } ); @@ -161881,6 +177360,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { \\"@id\\": formatIri(v) } ); @@ -161982,6 +177462,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -162114,6 +177596,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Service)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -162178,7 +177663,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162219,7 +177709,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162320,11 +177815,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162367,11 +177872,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://w3id.org/fep/7aa9#FeaturedCollection\\"].some( t => v[\\"@type\\"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162412,7 +177927,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162453,7 +177973,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162494,7 +178019,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162535,7 +178065,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162576,7 +178111,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162617,7 +178157,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162658,7 +178203,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162690,7 +178240,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162878,23 +178433,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162936,23 +178516,48 @@ get attributionDomains(): (string)[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162993,7 +178598,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -163098,6 +178708,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Service.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -163718,7 +179338,7 @@ get attributionDomains(): (string)[] { }; /** Contents of {@link Object}'s \`source\`. */ -export class Source { +export class Source implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -163734,6 +179354,14 @@ export class Source { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get \\"~fedify.vocab\\"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -163927,6 +179555,10 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -163967,6 +179599,7 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.length < vocabSparseArrayMinimumLength ? this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice() : vocabCopyPropertyArray(this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content); if (\\"content\\" in values && values.content != null) { @@ -164059,9 +179692,10 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -164118,6 +179752,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Source, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#content\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Source).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + + let element = ( +typeof v === \\"string\\" ?{ \\"@value\\": v } :{ + \\"@value\\": v.toString(), + \\"@language\\": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Source).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#content\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#mediaType\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Source).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Source).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The source content. */ @@ -164237,6 +179956,7 @@ get contents(): ((string | LanguageString))[] { const values: Record = {}; array = []; for (const v of this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + let element = ( typeof v === \\"string\\" ? { \\"@value\\": v } : { \\"@value\\": v.toString(), @@ -164260,6 +179980,7 @@ get contents(): ((string | LanguageString))[] { array = []; for (const v of this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + let element = ( { \\"@value\\": v } ); @@ -164340,6 +180061,8 @@ get contents(): ((string | LanguageString))[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -164538,6 +180261,16 @@ get contents(): ((string | LanguageString))[] { } instance.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Source.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -164728,6 +180461,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -164799,9 +180536,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -164976,6 +180714,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -165108,6 +180848,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof TentativeAccept)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -165115,6 +180858,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + TentativeAccept.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -165244,6 +180997,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -165315,9 +181072,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -165492,6 +181250,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -165624,6 +181384,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof TentativeReject)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -165631,6 +181394,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + TentativeReject.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -165831,6 +181604,10 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -165972,9 +181749,10 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -166029,6 +181807,75 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} }; return deepCloneGraph(this, this.clone(values, cloneOptions)); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#formerType\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Tombstone).#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { + + let element = ( +{ \\"@id\\": v.typeId.href } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Tombstone).#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#formerType\\", descriptor); + + descriptor = { + canonicalIri: \\"https://www.w3.org/ns/activitystreams#deleted\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Tombstone).#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { + + let element = ( +{ + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Tombstone).#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; + }, + }; + descriptors.set(\\"https://www.w3.org/ns/activitystreams#deleted\\", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** On a \`Tombstone\` object, the \`formerType\` property identifies the type of * the object that was deleted. @@ -166101,57 +181948,766 @@ get formerTypes(): ($EntityType)[] { // child documents back in place of their placeholders. const signedValues = enterSignedValueScope(options); - if (options.format == null && this.isCompactable()) { - - const result = await super.toJsonLd({ - ...options, - format: undefined, - context: undefined, - }) as Record; - - // deno-lint-ignore no-unused-vars - let compactItems: unknown[]; - - compactItems = []; - for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { - const item = ( - { \\"@id\\": v.typeId.href } - ); - compactItems.push(item); - } - if (compactItems.length > 0) { - - result[\\"formerType\\"] - = compactItems.length > 1 - ? compactItems - : compactItems[0]; - - } - - compactItems = []; - for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { - const item = ( - v.toString() - ); - compactItems.push(item); - } - if (compactItems.length > 0) { - - result[\\"deleted\\"] - = compactItems.length > 1 - ? compactItems - : compactItems[0]; - - } - - result[\\"type\\"] = \\"Tombstone\\"; - if (this.id != null) result[\\"id\\"] = formatIri(this.id); - result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; - return signedValues.owner - ? resolveSignedValues(result, signedValues.scope) - : result; - } - + if (options.format == null && this.isCompactable()) { + + const result = await super.toJsonLd({ + ...options, + format: undefined, + context: undefined, + }) as Record; + + // deno-lint-ignore no-unused-vars + let compactItems: unknown[]; + + compactItems = []; + for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { + const item = ( + { \\"@id\\": v.typeId.href } + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"formerType\\"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + + compactItems = []; + for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { + const item = ( + v.toString() + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result[\\"deleted\\"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + + result[\\"type\\"] = \\"Tombstone\\"; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); + result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + return signedValues.owner + ? resolveSignedValues(result, signedValues.scope) + : result; + } + + // deno-lint-ignore no-unused-vars prefer-const + let array: unknown[]; + + const baseValues = await super.toJsonLd({ + ...options, + format: \\"expand\\", + context: undefined, + }) as unknown[]; + const values = baseValues[0] as Record< + string, + unknown[] | { \\"@list\\": unknown[] } | string + >; + + array = []; + for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { + + let element = ( + { \\"@id\\": v.typeId.href } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values[\\"https://www.w3.org/ns/activitystreams#formerType\\"] = propValue; + + } + + array = []; + for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { + + let element = ( + { + \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", + \\"@value\\": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values[\\"https://www.w3.org/ns/activitystreams#deleted\\"] = propValue; + + } + + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Tombstone\\"]; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); + if (options.format === \\"expand\\") { + return await jsonld.expand( + values, + { + documentLoader: options.contextLoader, + keepFreeFloatingNodes: true, + }, + ); + } + let docContext: Parameters[1] = options.context ?? + [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + + if (options.context == null) { + const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; + const additionalContexts = getExtraContexts(values).filter( + context => !currentContexts.includes(context) + ); + if (additionalContexts.length > 0) { + docContext = [...currentContexts, ...additionalContexts]; + } + } + + let compacted = await jsonld.compact( + values, + docContext, + { documentLoader: options.contextLoader }, + ); + + if (options.context == null) { + const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; + const additionalContexts = getExtraContexts(compacted).filter( + context => !currentContexts.includes(context) + ); + if (additionalContexts.length > 0) { + docContext = [...currentContexts, ...additionalContexts]; + compacted = await jsonld.compact(values, docContext, { + documentLoader: options.contextLoader, + }); + } + } + + if (docContext != null) { + // Embed context + + if (\\"proof\\" in compacted && + compacted.proof != null) { + if (Array.isArray(compacted.proof)) { + for (const element of compacted.proof) { + element[\\"@context\\"] = docContext; + } + } else { + compacted.proof[\\"@context\\"] = docContext; + } + } + + } + return signedValues.owner + ? resolveSignedValues(compacted, signedValues.scope) + : compacted; + } + + protected override isCompactable(): boolean { + + if ( + this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType != null && + this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0 + ) return false; + + return super.isCompactable(); + } + + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#deleted\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#formerType\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + + /** + * Converts a JSON-LD structure to an object of this type. + * @param json The JSON-LD structure to convert. + * @param options The options to use. + * - \`documentLoader\`: The loader for remote JSON-LD documents. + * - \`contextLoader\`: The loader for remote JSON-LD contexts. + * - \`tracerProvider\`: The OpenTelemetry tracer provider to use. + * If omitted, the global tracer provider is used. + * - \`verifyPortableObject\`: The default FEP-ef61 portable + * object verifier for the property accessors of the + * returned object and the objects obtained from it. It + * does not verify the given \`json\` itself. + * @returns The object of this type. + * @throws {TypeError} If the given \`json\` is invalid. + */ + static override async fromJsonLd( + json: unknown, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + baseUrl?: URL, + } = {}, + ): Promise { + const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); + const tracer = tracerProvider.getTracer( + \\"@fedify/vocab-tools\\", + \\"0.0.0\\", + ); + return await tracer.startActiveSpan( + \\"activitypub.parse_object\\", + async (span) => { + try { + const object = await this.__fromJsonLd__Tombstone__( + json, span, options); + if (object.id != null) { + span.setAttribute(\\"activitypub.object.id\\", object.id.href); + } + return object; + } catch (error) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: String(error), + }); + throw error; + } finally { + span.end(); + } + }, + ); + } + + protected static async __fromJsonLd__Tombstone__( + json: unknown, + span: Span, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + baseUrl?: URL, + } = {}, + ): Promise { + if (typeof json === \\"undefined\\") { + throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); + } + else if (json === null) throw new TypeError(\\"Invalid JSON-LD: null.\\"); + options = { + ...options, + documentLoader: options.documentLoader ?? getDocumentLoader(), + contextLoader: options.contextLoader ?? getDocumentLoader(), + tracerProvider: options.tracerProvider ?? trace.getTracerProvider(), + }; + // deno-lint-ignore no-explicit-any + let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; + if ( + \\"_fromSubclass\\" in options && + options._fromSubclass && + typeof json === \\"object\\" && + !Array.isArray(json) + ) { + values = + // deno-lint-ignore no-explicit-any + json as (Record & { \\"@id\\"?: string }); + expanded = [values]; + } else if (globalThis.Object.keys(json).length == 0) { + values = {}; + expanded = [values]; + } else { + expanded = await jsonld.expand(json, { + documentLoader: options.contextLoader, + keepFreeFloatingNodes: true, + }); + values = + // deno-lint-ignore no-explicit-any + (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); + } + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; + } + + if (\\"@type\\" in values) { + span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); + } + if (\\"@type\\" in values && + !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { + + if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Tombstone\\")) { + throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); + } + } + + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) + : undefined; + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); + } + + const superValues = structuredClone(values); + delete superValues[\\"@type\\"]; + const instance = await super.fromJsonLd(superValues, { + ...options, + // @ts-ignore: an internal option + _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, + }); + if (!(instance instanceof Tombstone)) { + throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); + } + + let shouldCacheJsonLd = instance._shouldCacheJsonLd; + const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType: ($EntityType)[] = []; + + let _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array = values[\\"https://www.w3.org/ns/activitystreams#formerType\\"]; + + for ( + const v of _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array == null + ? [] + : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array.length === 1 && \\"@list\\" in _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0] + ? _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0][\\"@list\\"] + : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array + ) { + if (v == null) continue; + + const decoded = + (() => { + if (v == null || typeof v !== \\"object\\" || !(\\"@id\\" in v) || + typeof v[\\"@id\\"] !== \\"string\\" || v[\\"@id\\"] === \\"\\") { + return undefined; + } + const entityType = getEntityTypeById(v[\\"@id\\"]); + if (entityType == null) { + getLogger([\\"fedify\\", \\"vocab\\"]).warn( + \\"Ignoring unknown vocabulary entity type reference: {typeId}\\", + { typeId: v[\\"@id\\"] }, + ); + } + return entityType; + })() + ; + + if (typeof decoded === \\"undefined\\") { + shouldCacheJsonLd = false; + continue; + } + + if (!this._shouldCacheDecodedJsonLd(decoded)) { + shouldCacheJsonLd = false; + } + _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.push(decoded); + + } + instance.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; + const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted: (Temporal.Instant)[] = []; + + let _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array = values[\\"https://www.w3.org/ns/activitystreams#deleted\\"]; + + for ( + const v of _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array == null + ? [] + : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array.length === 1 && \\"@list\\" in _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0] + ? _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0][\\"@list\\"] + : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array + ) { + if (v == null) continue; + + const decoded = + Temporal.Instant.from( + v[\\"@value\\"].substring(19).match(/[Z+-]/) + ? v[\\"@value\\"] + : v[\\"@value\\"] + \\"Z\\" + ) + ; + + if (typeof decoded === \\"undefined\\") { + shouldCacheJsonLd = false; + continue; + } + + if (!this._shouldCacheDecodedJsonLd(decoded)) { + shouldCacheJsonLd = false; + } + _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(decoded); + + } + instance.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; + + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Tombstone.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } + instance._shouldCacheJsonLd = shouldCacheJsonLd; + if ( + shouldCacheJsonLd && + (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) + ) { + try { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const normalized = cacheJsonLd; + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + } else { + instance._cachedJsonLd = structuredClone(json); + } + } catch { + getLogger([\\"fedify\\", \\"vocab\\"]).warn( + \\"Failed to cache JSON-LD: {json}\\", + { json }, + ); + } + } + return instance; + } + + protected override _getCustomInspectProxy(): Record { + const proxy: Record = super._getCustomInspectProxy(); + const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(inspectIri(v), options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(inspectIri(v), options), + } + : v); + + if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length == 1) { + proxy.formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType[0]; + } + + if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 1 + || !(\\"formerType\\" in proxy) + && _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0) { + proxy.formerTypes = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; + } + + const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for(\\"Deno.customInspect\\")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => \\"URL \\" + inspect(inspectIri(v), options), + [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => \\"URL \\" + inspect(inspectIri(v), options), + } + : v); + + if (_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.length == 1) { + proxy.deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted[0]; + } + + return proxy; + } + } + + +// deno-lint-ignore no-explicit-any +(Tombstone.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = + function ( + this: Tombstone, + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"Tombstone \\" + inspect(proxy, options); + }; + +// deno-lint-ignore no-explicit-any +(Tombstone.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = + function ( + this: Tombstone, + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string { + const proxy = this._getCustomInspectProxy(); + return \\"Tombstone \\" + inspect(proxy, options); + }; + /** Indicates that the \`actor\` is traveling to \`target\` from \`origin\`. + * \`Travel\` is an \`IntransitiveObject\` whose \`actor\` specifies the direct object. + * If the \`target\` or \`origin\` are not specified, + * either can be determined by context. + * + */ +export class Travel extends IntransitiveActivity { + + /** + * The type URI of {@link Travel}: \`https://www.w3.org/ns/activitystreams#Travel\`. + */ + static override get typeId(): URL { + return new URL(\\"https://www.w3.org/ns/activitystreams#Travel\\"); + } + + /** + * Constructs a new instance of Travel with the given values. + * @param values The values to initialize the instance with. + * @param options The options to use for initialization. + */ + constructor( + values: + { +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} +, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + } = {}, + ) { + super(values, options);} + + /** + * Clones this instance, optionally updating it with the given values. + * + * This is a shallow copy: property arrays are copied, but nested objects + * and URLs are shared with this instance. Dereferencing accessors can cache + * fetched objects in the instance whose accessor is called. Hydrating a + * shared nested object through the clone can affect the original as well, + * and can change JSON-LD output when either is embedded in another + * object. Hydrating a top-level property of the clone does not update this + * instance's property. + * + * To resolve properties without sharing nested objects, use + * {@link Travel.deepClone} before hydration. + * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) + * for details, including how cached JSON-LD affects serialization. + * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * + * A clone never inherits a signed JSON-LD representation retained by + * \`signObject()\`: the clone may differ from the document that the proof + * covers, so embedding the original secured JSON in a parent document + * would be wrong. Sign the clone again if it has to be embedded as a + * secured child. + * + * @param values The values to update the clone with. + * @param options The options to use for cloning. + * @returns The cloned instance with its own property arrays. Nested objects + * and URLs are shared with this instance. + */ + override clone( + values: + { +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {} + ): Travel { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: $warning is not recognized as a property, but it is. + options = { ...options, $warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as Travel; + return clone; + } + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Travel { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + + /** + * Converts this object to a JSON-LD structure. + * @param options The options to use. + * - \`format\`: The format of the output: \`compact\` or + \`expand\`. + * - \`contextLoader\`: The loader for remote JSON-LD contexts. + * - \`context\`: The JSON-LD context to use. Not applicable + when \`format\` is set to \`'expand'\`. + * @returns The JSON-LD representation of this object. + */ + override async toJsonLd(options: { + format?: \\"compact\\" | \\"expand\\", + contextLoader?: DocumentLoader, + context?: string | Record | (string | Record)[], + } = {}): Promise { + if (options.format == null && this._cachedJsonLd != null) { + return this._cachedJsonLd; + } + if (options.format !== \\"compact\\" && options.context != null) { + throw new TypeError( + \\"The context option can only be used when the format option is set \\" + + \\"to 'compact'.\\" + ); + } + options = { + ...options, + contextLoader: options.contextLoader ?? getDocumentLoader(), + }; + // Joins the enclosing frame's signed-value scope, or starts one when this + // frame is the outermost. Only the owning frame puts retained signed + // child documents back in place of their placeholders. + const signedValues = enterSignedValueScope(options); + // deno-lint-ignore no-unused-vars prefer-const let array: unknown[]; @@ -166165,50 +182721,7 @@ get formerTypes(): ($EntityType)[] { unknown[] | { \\"@list\\": unknown[] } | string >; - array = []; - for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { - let element = ( - { \\"@id\\": v.typeId.href } - ); - if (Array.isArray(element)) { - if (element.length < 1) continue; - if (element.length == 1) element = element[0]; - } - if (typeof element === \\"undefined\\") continue; - array.push(element);; - } - if (array.length > 0) { - const propValue = ( - array - ); - values[\\"https://www.w3.org/ns/activitystreams#formerType\\"] = propValue; - - } - - array = []; - for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { - let element = ( - { - \\"@type\\": \\"http://www.w3.org/2001/XMLSchema#dateTime\\", - \\"@value\\": v.toString(), - } - ); - if (Array.isArray(element)) { - if (element.length < 1) continue; - if (element.length == 1) element = element[0]; - } - if (typeof element === \\"undefined\\") continue; - array.push(element);; - } - if (array.length > 0) { - const propValue = ( - array - ); - values[\\"https://www.w3.org/ns/activitystreams#deleted\\"] = propValue; - - } - - values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Tombstone\\"]; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Travel\\"]; if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( @@ -166220,7 +182733,7 @@ get formerTypes(): ($EntityType)[] { ); } let docContext: Parameters[1] = options.context ?? - [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; if (options.context == null) { const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; @@ -166273,14 +182786,11 @@ get formerTypes(): ($EntityType)[] { protected override isCompactable(): boolean { - if ( - this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType != null && - this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0 - ) return false; - return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -166305,7 +182815,7 @@ get formerTypes(): ($EntityType)[] { verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); const tracer = tracerProvider.getTracer( \\"@fedify/vocab-tools\\", @@ -166315,7 +182825,7 @@ get formerTypes(): ($EntityType)[] { \\"activitypub.parse_object\\", async (span) => { try { - const object = await this.__fromJsonLd__Tombstone__( + const object = await this.__fromJsonLd__Travel__( json, span, options); if (object.id != null) { span.setAttribute(\\"activitypub.object.id\\", object.id.href); @@ -166334,7 +182844,7 @@ get formerTypes(): ($EntityType)[] { ); } - protected static async __fromJsonLd__Tombstone__( + protected static async __fromJsonLd__Travel__( json: unknown, span: Span, options: { @@ -166344,7 +182854,7 @@ get formerTypes(): ($EntityType)[] { verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { if (typeof json === \\"undefined\\") { throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); } @@ -166391,7 +182901,7 @@ get formerTypes(): ($EntityType)[] { if (\\"@type\\" in values && !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { - if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Tombstone\\")) { + if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Travel\\")) { throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); } } @@ -166413,88 +182923,26 @@ get formerTypes(): ($EntityType)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); - if (!(instance instanceof Tombstone)) { + if (!(instance instanceof Travel)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); } let shouldCacheJsonLd = instance._shouldCacheJsonLd; - const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType: ($EntityType)[] = []; - - let _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array = values[\\"https://www.w3.org/ns/activitystreams#formerType\\"]; - - for ( - const v of _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array == null - ? [] - : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array.length === 1 && \\"@list\\" in _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0] - ? _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0][\\"@list\\"] - : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array - ) { - if (v == null) continue; - - const decoded = - (() => { - if (v == null || typeof v !== \\"object\\" || !(\\"@id\\" in v) || - typeof v[\\"@id\\"] !== \\"string\\" || v[\\"@id\\"] === \\"\\") { - return undefined; - } - const entityType = getEntityTypeById(v[\\"@id\\"]); - if (entityType == null) { - getLogger([\\"fedify\\", \\"vocab\\"]).warn( - \\"Ignoring unknown vocabulary entity type reference: {typeId}\\", - { typeId: v[\\"@id\\"] }, - ); - } - return entityType; - })() - ; - - if (typeof decoded === \\"undefined\\") { - shouldCacheJsonLd = false; - continue; - } - - if (!this._shouldCacheDecodedJsonLd(decoded)) { - shouldCacheJsonLd = false; - } - _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.push(decoded); - - } - instance.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; - const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted: (Temporal.Instant)[] = []; - - let _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array = values[\\"https://www.w3.org/ns/activitystreams#deleted\\"]; - - for ( - const v of _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array == null - ? [] - : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array.length === 1 && \\"@list\\" in _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0] - ? _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0][\\"@list\\"] - : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array + + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false ) { - if (v == null) continue; - - const decoded = - Temporal.Instant.from( - v[\\"@value\\"].substring(19).match(/[Z+-]/) - ? v[\\"@value\\"] - : v[\\"@value\\"] + \\"Z\\" - ) - ; - - if (typeof decoded === \\"undefined\\") { - shouldCacheJsonLd = false; - continue; - } - - if (!this._shouldCacheDecodedJsonLd(decoded)) { - shouldCacheJsonLd = false; - } - _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(decoded); - + const retained = retainRawProperties( + values, + Travel.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); } - instance.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; - instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -166526,96 +182974,53 @@ get formerTypes(): ($EntityType)[] { protected override _getCustomInspectProxy(): Record { const proxy: Record = super._getCustomInspectProxy(); - const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType - // deno-lint-ignore no-explicit-any - .map((v: any) => v instanceof URL - ? { - [Symbol.for(\\"Deno.customInspect\\")]: ( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string => \\"URL \\" + inspect(inspectIri(v), options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(inspectIri(v), options), - } - : v); - - if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length == 1) { - proxy.formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType[0]; - } - - if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 1 - || !(\\"formerType\\" in proxy) - && _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0) { - proxy.formerTypes = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; - } - - const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted - // deno-lint-ignore no-explicit-any - .map((v: any) => v instanceof URL - ? { - [Symbol.for(\\"Deno.customInspect\\")]: ( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string => \\"URL \\" + inspect(inspectIri(v), options), - [Symbol.for(\\"nodejs.util.inspect.custom\\")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => \\"URL \\" + inspect(inspectIri(v), options), - } - : v); - - if (_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.length == 1) { - proxy.deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted[0]; - } - return proxy; } } // deno-lint-ignore no-explicit-any -(Tombstone.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = +(Travel.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = function ( - this: Tombstone, + this: Travel, inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Tombstone \\" + inspect(proxy, options); + return \\"Travel \\" + inspect(proxy, options); }; // deno-lint-ignore no-explicit-any -(Tombstone.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = +(Travel.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = function ( - this: Tombstone, + this: Travel, _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Tombstone \\" + inspect(proxy, options); + return \\"Travel \\" + inspect(proxy, options); }; - /** Indicates that the \`actor\` is traveling to \`target\` from \`origin\`. - * \`Travel\` is an \`IntransitiveObject\` whose \`actor\` specifies the direct object. - * If the \`target\` or \`origin\` are not specified, - * either can be determined by context. + /** Indicates that the \`actor\` is undoing the \`object\`. In most cases, + * the \`object\` will be an {@link Activity} describing some previously performed + * action (for instance, a person may have previously \\"liked\\" an article but, + * for whatever reason, might choose to undo that like at some later point in + * time). + * + * The \`target\` and \`origin\` typically have no defined meaning. * */ -export class Travel extends IntransitiveActivity { +export class Undo extends Activity { /** - * The type URI of {@link Travel}: \`https://www.w3.org/ns/activitystreams#Travel\`. + * The type URI of {@link Undo}: \`https://www.w3.org/ns/activitystreams#Undo\`. */ static override get typeId(): URL { - return new URL(\\"https://www.w3.org/ns/activitystreams#Travel\\"); + return new URL(\\"https://www.w3.org/ns/activitystreams#Undo\\"); } /** - * Constructs a new instance of Travel with the given values. + * Constructs a new instance of Undo with the given values. * @param values The values to initialize the instance with. * @param options The options to use for initialization. */ @@ -166668,10 +183073,14 @@ instruments?: (Object | URL)[];} * instance's property. * * To resolve properties without sharing nested objects, use - * {@link Travel.deepClone} before hydration. + * {@link Undo.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -166717,7 +183126,7 @@ instruments?: (Object | URL)[];} contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, } = {} - ): Travel { + ): Undo { if (this._warning != null) { getLogger(this._warning.category).warn( this._warning.message, @@ -166726,7 +183135,7 @@ instruments?: (Object | URL)[];} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Travel; + const clone = super.clone(values, options) as unknown as Undo; return clone; } @@ -166743,9 +183152,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -166795,7 +183205,7 @@ instruments?: (Object | URL)[];} documentLoader?: DocumentLoader, contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, - } = {}): Travel { + } = {}): Undo { const cloneOptions = { documentLoader: options.documentLoader ?? this._documentLoader, contextLoader: options.contextLoader ?? this._contextLoader, @@ -166852,7 +183262,7 @@ instruments?: (Object | URL)[];} unknown[] | { \\"@list\\": unknown[] } | string >; - values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Travel\\"]; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Undo\\"]; if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( @@ -166864,7 +183274,7 @@ instruments?: (Object | URL)[];} ); } let docContext: Parameters[1] = options.context ?? - [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; + [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"litepub\\":\\"http://litepub.social/ns#\\",\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"EmojiReact\\":\\"litepub:EmojiReact\\",\\"Emoji\\":\\"toot:Emoji\\"}]; if (options.context == null) { const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; @@ -166920,6 +183330,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -166944,7 +183356,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); const tracer = tracerProvider.getTracer( \\"@fedify/vocab-tools\\", @@ -166954,7 +183366,7 @@ instruments?: (Object | URL)[];} \\"activitypub.parse_object\\", async (span) => { try { - const object = await this.__fromJsonLd__Travel__( + const object = await this.__fromJsonLd__Undo__( json, span, options); if (object.id != null) { span.setAttribute(\\"activitypub.object.id\\", object.id.href); @@ -166973,7 +183385,7 @@ instruments?: (Object | URL)[];} ); } - protected static async __fromJsonLd__Travel__( + protected static async __fromJsonLd__Undo__( json: unknown, span: Span, options: { @@ -166983,7 +183395,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { if (typeof json === \\"undefined\\") { throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); } @@ -167030,7 +183442,7 @@ instruments?: (Object | URL)[];} if (\\"@type\\" in values && !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { - if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Travel\\")) { + if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Undo\\")) { throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); } } @@ -167052,13 +183464,26 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); - if (!(instance instanceof Travel)) { + if (!(instance instanceof Undo)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); } let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Undo.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -167096,47 +183521,45 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any -(Travel.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = +(Undo.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = function ( - this: Travel, + this: Undo, inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Travel \\" + inspect(proxy, options); + return \\"Undo \\" + inspect(proxy, options); }; // deno-lint-ignore no-explicit-any -(Travel.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = +(Undo.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = function ( - this: Travel, + this: Undo, _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string { const proxy = this._getCustomInspectProxy(); - return \\"Travel \\" + inspect(proxy, options); + return \\"Undo \\" + inspect(proxy, options); }; - /** Indicates that the \`actor\` is undoing the \`object\`. In most cases, - * the \`object\` will be an {@link Activity} describing some previously performed - * action (for instance, a person may have previously \\"liked\\" an article but, - * for whatever reason, might choose to undo that like at some later point in - * time). + /** Indicates that the \`actor\` has updated the \`object\`. Note, however, + * that this vocabulary does not define a mechanism for describing the actual + * set of modifications made to \`object\`. * * The \`target\` and \`origin\` typically have no defined meaning. * */ -export class Undo extends Activity { +export class Update extends Activity { /** - * The type URI of {@link Undo}: \`https://www.w3.org/ns/activitystreams#Undo\`. + * The type URI of {@link Update}: \`https://www.w3.org/ns/activitystreams#Update\`. */ static override get typeId(): URL { - return new URL(\\"https://www.w3.org/ns/activitystreams#Undo\\"); + return new URL(\\"https://www.w3.org/ns/activitystreams#Update\\"); } /** - * Constructs a new instance of Undo with the given values. + * Constructs a new instance of Update with the given values. * @param values The values to initialize the instance with. * @param options The options to use for initialization. */ @@ -167189,10 +183612,14 @@ instruments?: (Object | URL)[];} * instance's property. * * To resolve properties without sharing nested objects, use - * {@link Undo.deepClone} before hydration. + * {@link Update.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -167238,7 +183665,7 @@ instruments?: (Object | URL)[];} contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, } = {} - ): Undo { + ): Update { if (this._warning != null) { getLogger(this._warning.category).warn( this._warning.message, @@ -167247,7 +183674,7 @@ instruments?: (Object | URL)[];} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Undo; + const clone = super.clone(values, options) as unknown as Update; return clone; } @@ -167264,9 +183691,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -167316,7 +183744,7 @@ instruments?: (Object | URL)[];} documentLoader?: DocumentLoader, contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, - } = {}): Undo { + } = {}): Update { const cloneOptions = { documentLoader: options.documentLoader ?? this._documentLoader, contextLoader: options.contextLoader ?? this._contextLoader, @@ -167373,7 +183801,7 @@ instruments?: (Object | URL)[];} unknown[] | { \\"@list\\": unknown[] } | string >; - values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Undo\\"]; + values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Update\\"]; if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( @@ -167385,7 +183813,7 @@ instruments?: (Object | URL)[];} ); } let docContext: Parameters[1] = options.context ?? - [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"litepub\\":\\"http://litepub.social/ns#\\",\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"EmojiReact\\":\\"litepub:EmojiReact\\",\\"Emoji\\":\\"toot:Emoji\\"}]; + [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"sensitive\\":\\"as:sensitive\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"attributionDomains\\":{\\"@id\\":\\"toot:attributionDomains\\",\\"@container\\":\\"@set\\"},\\"votersCount\\":{\\"@id\\":\\"toot:votersCount\\",\\"@type\\":\\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\"},\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; if (options.context == null) { const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; @@ -167441,6 +183869,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -167465,7 +183895,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); const tracer = tracerProvider.getTracer( \\"@fedify/vocab-tools\\", @@ -167475,7 +183905,7 @@ instruments?: (Object | URL)[];} \\"activitypub.parse_object\\", async (span) => { try { - const object = await this.__fromJsonLd__Undo__( + const object = await this.__fromJsonLd__Update__( json, span, options); if (object.id != null) { span.setAttribute(\\"activitypub.object.id\\", object.id.href); @@ -167494,7 +183924,7 @@ instruments?: (Object | URL)[];} ); } - protected static async __fromJsonLd__Undo__( + protected static async __fromJsonLd__Update__( json: unknown, span: Span, options: { @@ -167504,7 +183934,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { if (typeof json === \\"undefined\\") { throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); } @@ -167551,7 +183981,7 @@ instruments?: (Object | URL)[];} if (\\"@type\\" in values && !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { - if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Undo\\")) { + if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Update\\")) { throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); } } @@ -167573,532 +184003,26 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); - if (!(instance instanceof Undo)) { + if (!(instance instanceof Update)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); } let shouldCacheJsonLd = instance._shouldCacheJsonLd; - instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( - shouldCacheJsonLd && - (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false ) { - try { - if (cacheJsonLd != null && cacheJsonLd !== expanded) { - const compactArray = Array.isArray(json) && json.length === 1; - const jsonLd = compactArray ? json[0] : json; - const normalized = cacheJsonLd; - const cachedJsonLd = await compactJsonLdCache( - normalized, - jsonLd, - options.contextLoader, - ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; - } else { - instance._cachedJsonLd = structuredClone(json); - } - } catch { - getLogger([\\"fedify\\", \\"vocab\\"]).warn( - \\"Failed to cache JSON-LD: {json}\\", - { json }, - ); - } - } - return instance; - } - - protected override _getCustomInspectProxy(): Record { - const proxy: Record = super._getCustomInspectProxy(); - return proxy; - } - } - - -// deno-lint-ignore no-explicit-any -(Undo.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] = - function ( - this: Undo, - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string { - const proxy = this._getCustomInspectProxy(); - return \\"Undo \\" + inspect(proxy, options); - }; - -// deno-lint-ignore no-explicit-any -(Undo.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] = - function ( - this: Undo, - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string { - const proxy = this._getCustomInspectProxy(); - return \\"Undo \\" + inspect(proxy, options); - }; - /** Indicates that the \`actor\` has updated the \`object\`. Note, however, - * that this vocabulary does not define a mechanism for describing the actual - * set of modifications made to \`object\`. - * - * The \`target\` and \`origin\` typically have no defined meaning. - * - */ -export class Update extends Activity { - - /** - * The type URI of {@link Update}: \`https://www.w3.org/ns/activitystreams#Update\`. - */ - static override get typeId(): URL { - return new URL(\\"https://www.w3.org/ns/activitystreams#Update\\"); - } - - /** - * Constructs a new instance of Update with the given values. - * @param values The values to initialize the instance with. - * @param options The options to use for initialization. - */ - constructor( - values: - { -id?: URL | null; -attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; -attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; -audiences?: (Object | URL)[];content?: string | LanguageString | null; -contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; -names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; -icons?: (Image | URL)[];image?: Image | URL | null; -images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; -replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; -locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; -previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; -summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; -urls?: ((URL | Link))[];to?: Object | URL | null; -tos?: (Object | URL)[];bto?: Object | URL | null; -btos?: (Object | URL)[];cc?: Object | URL | null; -ccs?: (Object | URL)[];bcc?: Object | URL | null; -bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; -actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; -objects?: (Object | URL)[];target?: Object | URL | null; -targets?: (Object | URL)[];result?: Object | URL | null; -results?: (Object | URL)[];origin?: Object | URL | null; -origins?: (Object | URL)[];instrument?: Object | URL | null; -instruments?: (Object | URL)[];} -, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, - verifyPortableObject?: PortableObjectVerifier, - } = {}, - ) { - super(values, options);} - - /** - * Clones this instance, optionally updating it with the given values. - * - * This is a shallow copy: property arrays are copied, but nested objects - * and URLs are shared with this instance. Dereferencing accessors can cache - * fetched objects in the instance whose accessor is called. Hydrating a - * shared nested object through the clone can affect the original as well, - * and can change JSON-LD output when either is embedded in another - * object. Hydrating a top-level property of the clone does not update this - * instance's property. - * - * To resolve properties without sharing nested objects, use - * {@link Update.deepClone} before hydration. - * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) - * for details, including how cached JSON-LD affects serialization. - * - * A clone never inherits a signed JSON-LD representation retained by - * \`signObject()\`: the clone may differ from the document that the proof - * covers, so embedding the original secured JSON in a parent document - * would be wrong. Sign the clone again if it has to be embedded as a - * secured child. - * - * @param values The values to update the clone with. - * @param options The options to use for cloning. - * @returns The cloned instance with its own property arrays. Nested objects - * and URLs are shared with this instance. - */ - override clone( - values: - { -id?: URL | null; -attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; -attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; -audiences?: (Object | URL)[];content?: string | LanguageString | null; -contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; -names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; -icons?: (Image | URL)[];image?: Image | URL | null; -images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; -replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; -locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; -previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; -summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; -urls?: ((URL | Link))[];to?: Object | URL | null; -tos?: (Object | URL)[];bto?: Object | URL | null; -btos?: (Object | URL)[];cc?: Object | URL | null; -ccs?: (Object | URL)[];bcc?: Object | URL | null; -bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; -actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; -objects?: (Object | URL)[];target?: Object | URL | null; -targets?: (Object | URL)[];result?: Object | URL | null; -results?: (Object | URL)[];origin?: Object | URL | null; -origins?: (Object | URL)[];instrument?: Object | URL | null; -instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): Update { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: $warning is not recognized as a property, but it is. - options = { ...options, $warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as Update; - return clone; - } - - /** - * Copies this instance and its nested vocabulary objects, optionally - * replacing property values. Replacement values are copied too. - * - * Property arrays, URLs and byte arrays are independent of the source. - * Repeated references remain shared within the copy. References to this - * source in replacement values receive a separate copy of its pre-update - * values, rather than referring back to the updated root. - * Other scalar values, including opaque cryptographic keys, are shared. - * - * Each copied object retains its own default loaders, tracer, verifier - * and base URL. Options override defaults only on the root instance. - * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. - * - * Trust and portable provenance follow clone() rules at every level. - * Historical referrers within the graph are copied without replacements; - * referrers outside the graph still point at the original external objects. - * Custom clone() overrides must return fresh, compatible instances and - * remain responsible for their own constructor and cloning side effects. - * Large sparse property arrays with ordinary data entries are copied using - * a snapshot of their length and present indices. Entries added after a - * snapshot are not visited; deleted entries are skipped, and values changed - * after the snapshot are read when reached. Custom - * clone() overrides must avoid structurally changing a field being copied - * if they need all its nested objects to be independent of the source. - * - * @param values The values to replace before copying the graph. - * @param options Root loader and verifier overrides. Undefined options - * retain the corresponding defaults. - * @returns An independent copy of the stored vocabulary graph. - * @since 2.5.0 - */ - override deepClone(values: -{ -id?: URL | null; -attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; -attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; -audiences?: (Object | URL)[];content?: string | LanguageString | null; -contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; -names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; -icons?: (Image | URL)[];image?: Image | URL | null; -images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; -replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; -locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; -previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; -summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; -urls?: ((URL | Link))[];to?: Object | URL | null; -tos?: (Object | URL)[];bto?: Object | URL | null; -btos?: (Object | URL)[];cc?: Object | URL | null; -ccs?: (Object | URL)[];bcc?: Object | URL | null; -bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; -actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; -objects?: (Object | URL)[];target?: Object | URL | null; -targets?: (Object | URL)[];result?: Object | URL | null; -results?: (Object | URL)[];origin?: Object | URL | null; -origins?: (Object | URL)[];instrument?: Object | URL | null; -instruments?: (Object | URL)[];} -= {}, options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {}): Update { - const cloneOptions = { - documentLoader: options.documentLoader ?? this._documentLoader, - contextLoader: options.contextLoader ?? this._contextLoader, - verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, - tracerProvider: this._tracerProvider, - baseUrl: this._baseUrl, - }; - return deepCloneGraph(this, this.clone(values, cloneOptions)); - } - - /** - * Converts this object to a JSON-LD structure. - * @param options The options to use. - * - \`format\`: The format of the output: \`compact\` or - \`expand\`. - * - \`contextLoader\`: The loader for remote JSON-LD contexts. - * - \`context\`: The JSON-LD context to use. Not applicable - when \`format\` is set to \`'expand'\`. - * @returns The JSON-LD representation of this object. - */ - override async toJsonLd(options: { - format?: \\"compact\\" | \\"expand\\", - contextLoader?: DocumentLoader, - context?: string | Record | (string | Record)[], - } = {}): Promise { - if (options.format == null && this._cachedJsonLd != null) { - return this._cachedJsonLd; - } - if (options.format !== \\"compact\\" && options.context != null) { - throw new TypeError( - \\"The context option can only be used when the format option is set \\" + - \\"to 'compact'.\\" - ); - } - options = { - ...options, - contextLoader: options.contextLoader ?? getDocumentLoader(), - }; - // Joins the enclosing frame's signed-value scope, or starts one when this - // frame is the outermost. Only the owning frame puts retained signed - // child documents back in place of their placeholders. - const signedValues = enterSignedValueScope(options); - - // deno-lint-ignore no-unused-vars prefer-const - let array: unknown[]; - - const baseValues = await super.toJsonLd({ - ...options, - format: \\"expand\\", - context: undefined, - }) as unknown[]; - const values = baseValues[0] as Record< - string, - unknown[] | { \\"@list\\": unknown[] } | string - >; - - values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Update\\"]; - if (this.id != null) values[\\"@id\\"] = formatIri(this.id); - if (options.format === \\"expand\\") { - return await jsonld.expand( + const retained = retainRawProperties( values, - { - documentLoader: options.contextLoader, - keepFreeFloatingNodes: true, - }, - ); - } - let docContext: Parameters[1] = options.context ?? - [\\"https://w3id.org/identity/v1\\",\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"sensitive\\":\\"as:sensitive\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"attributionDomains\\":{\\"@id\\":\\"toot:attributionDomains\\",\\"@container\\":\\"@set\\"},\\"votersCount\\":{\\"@id\\":\\"toot:votersCount\\",\\"@type\\":\\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\\"},\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; - - if (options.context == null) { - const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; - const additionalContexts = getExtraContexts(values).filter( - context => !currentContexts.includes(context) - ); - if (additionalContexts.length > 0) { - docContext = [...currentContexts, ...additionalContexts]; - } - } - - let compacted = await jsonld.compact( - values, - docContext, - { documentLoader: options.contextLoader }, - ); - - if (options.context == null) { - const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; - const additionalContexts = getExtraContexts(compacted).filter( - context => !currentContexts.includes(context) + Update.#knownRawPropertyIris, ); - if (additionalContexts.length > 0) { - docContext = [...currentContexts, ...additionalContexts]; - compacted = await jsonld.compact(values, docContext, { - documentLoader: options.contextLoader, - }); - } - } - - if (docContext != null) { - // Embed context - - if (\\"proof\\" in compacted && - compacted.proof != null) { - if (Array.isArray(compacted.proof)) { - for (const element of compacted.proof) { - element[\\"@context\\"] = docContext; - } - } else { - compacted.proof[\\"@context\\"] = docContext; - } - } - + if (retained != null) retainedRawProperties.set(instance, retained); } - return signedValues.owner - ? resolveSignedValues(compacted, signedValues.scope) - : compacted; - } - - protected override isCompactable(): boolean { - - return super.isCompactable(); - } - - /** - * Converts a JSON-LD structure to an object of this type. - * @param json The JSON-LD structure to convert. - * @param options The options to use. - * - \`documentLoader\`: The loader for remote JSON-LD documents. - * - \`contextLoader\`: The loader for remote JSON-LD contexts. - * - \`tracerProvider\`: The OpenTelemetry tracer provider to use. - * If omitted, the global tracer provider is used. - * - \`verifyPortableObject\`: The default FEP-ef61 portable - * object verifier for the property accessors of the - * returned object and the objects obtained from it. It - * does not verify the given \`json\` itself. - * @returns The object of this type. - * @throws {TypeError} If the given \`json\` is invalid. - */ - static override async fromJsonLd( - json: unknown, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, - verifyPortableObject?: PortableObjectVerifier, - baseUrl?: URL, - } = {}, - ): Promise { - const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); - const tracer = tracerProvider.getTracer( - \\"@fedify/vocab-tools\\", - \\"0.0.0\\", - ); - return await tracer.startActiveSpan( - \\"activitypub.parse_object\\", - async (span) => { - try { - const object = await this.__fromJsonLd__Update__( - json, span, options); - if (object.id != null) { - span.setAttribute(\\"activitypub.object.id\\", object.id.href); - } - return object; - } catch (error) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: String(error), - }); - throw error; - } finally { - span.end(); - } - }, - ); - } - - protected static async __fromJsonLd__Update__( - json: unknown, - span: Span, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, - verifyPortableObject?: PortableObjectVerifier, - baseUrl?: URL, - } = {}, - ): Promise { - if (typeof json === \\"undefined\\") { - throw new TypeError(\\"Invalid JSON-LD: undefined.\\"); - } - else if (json === null) throw new TypeError(\\"Invalid JSON-LD: null.\\"); - options = { - ...options, - documentLoader: options.documentLoader ?? getDocumentLoader(), - contextLoader: options.contextLoader ?? getDocumentLoader(), - tracerProvider: options.tracerProvider ?? trace.getTracerProvider(), - }; - // deno-lint-ignore no-explicit-any - let values: Record & { \\"@id\\"?: string }; - let expanded: unknown[]; - if ( - \\"_fromSubclass\\" in options && - options._fromSubclass && - typeof json === \\"object\\" && - !Array.isArray(json) - ) { - values = - // deno-lint-ignore no-explicit-any - json as (Record & { \\"@id\\"?: string }); - expanded = [values]; - } else if (globalThis.Object.keys(json).length == 0) { - values = {}; - expanded = [values]; - } else { - expanded = await jsonld.expand(json, { - documentLoader: options.contextLoader, - keepFreeFloatingNodes: true, - }); - values = - // deno-lint-ignore no-explicit-any - (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); - } - const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); - if (id != null && options.baseUrl == null) { - options = { ...options, baseUrl: id }; - } - - if (\\"@type\\" in values) { - span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); - } - if (\\"@type\\" in values && - !values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) { - - if (!values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Update\\")) { - throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]); - } - } - - let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizeJsonLdIris( - expanded, - PORTABLE_IRI_KEYS, - PORTABLE_IRI_PATTERN, - ) - : undefined; - if (cacheJsonLd != null && cacheJsonLd !== expanded) { - cacheJsonLd = structuredClone(cacheJsonLd); - } - - const superValues = structuredClone(values); - delete superValues[\\"@type\\"]; - const instance = await super.fromJsonLd(superValues, { - ...options, - // @ts-ignore: an internal option - _fromSubclass: true, - }); - if (!(instance instanceof Update)) { - throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); - } - - let shouldCacheJsonLd = instance._shouldCacheJsonLd; - instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -168220,6 +184144,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -168285,9 +184213,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -168475,6 +184404,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#height\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/activitystreams#width\\",\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -168607,6 +184538,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Video)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -168614,6 +184548,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Video.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -168742,6 +184686,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -168813,9 +184761,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -168990,6 +184939,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://purl.org/dc/terms/license\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/security#proof\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -169122,6 +185073,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof View)) { throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name); @@ -169129,6 +185083,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !(\\"_retainsRawProperties\\" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + View.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index a996f64c1..41f0ac782 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -27,7 +27,9 @@ import { parseIri, parseJsonLdId, type PortableObjectVerifier, - type RemoteDocument + type RawPropertyValue, + type RemoteDocument, + type VocabularyObject } from "@fedify/vocab-runtime"; import { compactJsonLdCache, @@ -56,6 +58,16 @@ import { rejectMalformedCompatibleReference, warnUnverifiableEmbeddedObject } from "@fedify/vocab-runtime/internal/portable-dereference"; +import { + createRawPropertyEncodingOptions, + encodeNestedVocabularyValue, + expandRawPropertyValue, + RAW_PROPERTY_PROTOCOL, + type RawPropertyRequest, + readRawPropertyValues, + retainRawProperties, + type RetainedRawProperties +} from "@fedify/vocab-runtime/internal/raw-property"; import { enterSignedValueScope, resolveSignedValues, @@ -369,6 +381,221 @@ function deepCloneGraph(source: object, root: T): T { return root; } +type RawPropertyEncoder = ( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, +) => Promise; + +interface RawPropertyDescriptor { + readonly canonicalIri: string; + readonly encode: RawPropertyEncoder; + readonly values: (object: object) => readonly unknown[]; +} + +// Unknown properties retained while decoding, keyed by the decoded object: +const retainedRawProperties = new WeakMap(); + +// Encoders of the properties each generated class declares, keyed by the +// class's prototype and then by the property IRIs, including aliases: +const rawPropertyDescriptors = new Map< + object, + ReadonlyMap +>(); + +function getRawPropertyDescriptor( + object: object, + iri: string, +): RawPropertyDescriptor | undefined { + let prototype: object | null = globalThis.Object.getPrototypeOf(object); + while (prototype != null) { + const descriptor = rawPropertyDescriptors.get(prototype)?.get(iri); + if (descriptor != null) return descriptor; + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return undefined; +} + +function copyRawProperties(source: object, destination: object): void { + const retained = retainedRawProperties.get(source); + if (retained == null) retainedRawProperties.delete(destination); + else retainedRawProperties.set(destination, retained); +} + +function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { + if ( + source == null || destination == null || + typeof source !== "object" || typeof destination !== "object" || + !(RAW_PROPERTY_PROTOCOL in source) || + globalThis.Object.getPrototypeOf(source) !== + globalThis.Object.getPrototypeOf(destination) + ) { + return false; + } + const sourceId = (source as unknown as { id: URL | null }).id; + const destinationId = (destination as unknown as { id: URL | null }).id; + return sourceId?.href === destinationId?.href; +} + +// Copies the retained unknown properties of a decoded object and of the +// objects nested in it to a copy of the same graph that was decoded again, +// pairing nested objects by property and position: +function copyRawPropertiesDeep( + source: object, + destination: object, + visited: Set = new Set(), +): void { + if (visited.has(destination)) return; + visited.add(destination); + copyRawProperties(source, destination); + if (!isSameRawPropertyNode(source, destination)) return; + const descriptors = new Set(); + let prototype: object | null = globalThis.Object.getPrototypeOf(destination); + while (prototype != null) { + for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { + descriptors.add(descriptor); + } + prototype = globalThis.Object.getPrototypeOf(prototype); + } + for (const descriptor of descriptors) { + const sources = descriptor.values(source); + const destinations = descriptor.values(destination); + const length = globalThis.Math.min(sources.length, destinations.length); + for (let i = 0; i < length; i++) { + if ( + sources[i] !== destinations[i] && + isSameRawPropertyNode(sources[i], destinations[i]) + ) { + copyRawPropertiesDeep( + sources[i] as object, + destinations[i] as object, + visited, + ); + } + } + } +} + +async function readRawProperty( + object: object, + request: RawPropertyRequest, + contextLoader: DocumentLoader, +): Promise { + const retained = retainedRawProperties.get(object); + for (const iri of request.candidates) { + const descriptor = getRawPropertyDescriptor(object, iri); + if (descriptor != null) { + const value = await descriptor.encode( + object, + createRawPropertyEncodingOptions(request.stack, contextLoader), + ); + return value === undefined ? [] : await expandRawPropertyValue( + descriptor.canonicalIri, + value, + contextLoader, + ); + } + if (retained != null && globalThis.Object.hasOwn(retained, iri)) { + return retained[iri]; + } + } + return []; +} + +/** + * Gets the values of a property of a vocabulary object in expanded JSON-LD, + * looking the property up by its full IRI. This works for properties that + * have no typed accessor as well as for those that do. + * + * *Raw* means untyped expanded JSON-LD values, such as + * \`{ "@value": "Hello" }\` or \`{ "@id": "https://example.com/" }\`, as + * opposed to the values that typed accessors return. It does not mean the + * received document: + * + * - For a property that the object's class has no accessor for, the result + * is the values retained when the object was decoded by \`fromJsonLd()\`. + * Objects constructed locally have none. + * - For a property that the class has an accessor for, including a + * redundant alias of such a property, the result is the current typed + * values encoded back into expanded JSON-LD. It reflects \`clone()\` + * replacements and objects fetched by dereferencing accessors, and it can + * differ from the received values: for example, values that failed to + * decode are missing, and lexical forms such as date-times are + * normalized. When a later release adds an accessor for a property, + * the result for that property switches from the retained values to the + * encoded ones. + * + * The values are not verified in any way, and IRIs in them are never + * dereferenced. Validate them before use, as with any other data received + * from a remote server. The result is a deep copy, so modifying it does not + * affect the object. + * + * The IRI is matched as given, and then as normalized by the WHATWG URL + * parser. Prefixes are never expanded: \`"as:content"\` is a valid IRI with + * the \`as:\` scheme, so it normally matches nothing. An IRI whose scheme is + * not \`http:\` or \`https:\` is therefore logged as a warning under the + * \`["fedify", "vocab"]\` category. + * + * \`\`\`typescript ignore + * const values = await getRawPropertyValues( + * note, + * "https://w3id.org/quantpub#structuredUrl", + * ); + * for (const value of values) { + * if ("@id" in value && typeof value["@id"] === "string") { + * console.log(new URL(value["@id"])); + * } + * } + * \`\`\` + * + * @param object The vocabulary object to read. It can be an object of any + * module generated by \`@fedify/vocab-tools\`. + * @param propertyIri The full IRI of the property. + * @returns The values of the property, or an empty array if it has none. + * @throws {TypeError} If \`propertyIri\` is not an absolute IRI, e.g., an + * empty string, a JSON-LD keyword such as \`"@id"\`, a + * blank node identifier, a term, or a relative + * reference; if \`object\` is not a generated vocabulary + * object; or if encoding the values of a known property + * meets a cycle of objects. + * @since 2.5.0 + */ +export function getRawPropertyValues( + object: VocabularyObject, + propertyIri: string | URL, +): Promise { + return readRawPropertyValues(object, propertyIri, "getRawPropertyValues"); +} + +/** + * Gets the first value of a property of a vocabulary object in expanded + * JSON-LD, looking the property up by its full IRI. It is equivalent to + * \`(await getRawPropertyValues(object, propertyIri))[0] ?? null\`; see + * {@link getRawPropertyValues} for how the values are obtained. + * + * It does not throw when the property has multiple values. JSON-LD does not + * order the values of a property unless it is a list, so the first value is + * not more significant than the others. A list property has a single value, + * the \`{ "@list": [...] }\` object. + * + * @param object The vocabulary object to read. It can be an object of any + * module generated by \`@fedify/vocab-tools\`. + * @param propertyIri The full IRI of the property. + * @returns The first value of the property, or \`null\` if it has none. + * @throws {TypeError} In the same cases as {@link getRawPropertyValues}. + * @since 2.5.0 + */ +export async function getRawPropertyValue( + object: VocabularyObject, + propertyIri: string | URL, +): Promise { + const values = await readRawPropertyValues( + object, + propertyIri, + "getRawPropertyValue", + ); + return values[0] ?? null; +} + function isValidLanguageTag(language: string): boolean { try { new Intl.Locale(normalizeLanguageTag(language)); @@ -451,7 +678,7 @@ import * as _ppM0 from "./preprocessors.ts"; * {@link OrderedCollection}. * */ -export class Object { +export class Object implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -467,6 +694,14 @@ export class Object { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -2132,6 +2367,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -2187,6 +2426,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length < vocabSparseArrayMinimumLength ? this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.slice() : vocabCopyPropertyArray(this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment);clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = vocabCopyTrustSet( this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, @@ -3771,9 +4011,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -4483,6 +4724,1380 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Object, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#attachment", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Link ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#attachment", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#attributedTo", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#attributedTo", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#audience", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#audience", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#content", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#content", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#context", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3mhZzGXSpQ431mBSz2kvych22v4e_context; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#context", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#name", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#name", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#endTime", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#endTime", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#generator", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#generator", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#icon", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#icon", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#image", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#image", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#inReplyTo", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#inReplyTo", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#location", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#location", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#preview", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Link ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#preview", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#published", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_5e258TDXtuhaFRPZiGoDfEpjdMr_published) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_5e258TDXtuhaFRPZiGoDfEpjdMr_published; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#published", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#replies", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_7UpwM3JWcXhADcscukEehBorf6k_replies) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_7UpwM3JWcXhADcscukEehBorf6k_replies; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#replies", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#shares", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3kAfck9PcEYt2L7xug5y99YPbANs_shares; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#shares", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#likes", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#likes", descriptor); + + descriptor = { + canonicalIri: "http://fedibird.com/ns#emojiReactions", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions; + }, + }; + descriptors.set("http://fedibird.com/ns#emojiReactions", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#startTime", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2w3Jmue4up8iVDUA51WZqomEF438_startTime) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2w3Jmue4up8iVDUA51WZqomEF438_startTime; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#startTime", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#summary", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#summary", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#tag", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_5chuqj6s95p5gg2sk1HntGfarRf_tag; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#tag", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#updated", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#updated", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#url", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + + let element = ( +v instanceof URL ?{ "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#url", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#to", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#to", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#bto", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#bto", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#cc", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#cc", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#bcc", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#bcc", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#mediaType", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#mediaType", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#duration", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#duration", + "@value": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#duration", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#sensitive", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#sensitive", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#source", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#source", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#proof", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push({ "@graph": element }); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; + }, + }; + descriptors.set("https://w3id.org/security#proof", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactionPolicy", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactionPolicy", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#approvedBy", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; + }, + }; + descriptors.set("https://gotosocial.org/ns#approvedBy", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#likeAuthorization", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; + }, + }; + descriptors.set("https://gotosocial.org/ns#likeAuthorization", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#replyAuthorization", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; + }, + }; + descriptors.set("https://gotosocial.org/ns#replyAuthorization", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#announceAuthorization", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization; + }, + }; + descriptors.set("https://gotosocial.org/ns#announceAuthorization", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/22cd#translations", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations; + }, + }; + descriptors.set("https://w3id.org/fep/22cd#translations", descriptor); + + descriptor = { + canonicalIri: "http://purl.org/dc/terms/license", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Object).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Object).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + }, + }; + descriptors.set("http://purl.org/dc/terms/license", descriptor); +descriptors.set("https://schema.org/license", descriptor); +descriptors.set("http://creativecommons.org/ns#license", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchAttachment( url: URL, @@ -4886,6 +6501,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#attachment_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -4898,6 +6514,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -5369,6 +6989,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#attribution_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -5381,6 +7002,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -5533,6 +7158,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#attribution_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -5545,6 +7171,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -5955,6 +7585,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#audience_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -5967,6 +7598,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -6118,6 +7753,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#audience_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -6130,6 +7766,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -6593,6 +8233,7 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#context_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -6605,6 +8246,10 @@ get contents(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -7075,6 +8720,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#generator_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -7087,6 +8733,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -7520,6 +9170,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#icon_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -7532,6 +9183,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -7684,6 +9339,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#icon_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -7696,6 +9352,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -8129,6 +9789,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#image_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -8141,6 +9802,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -8293,6 +9958,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#image_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -8305,6 +9971,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -8730,6 +10400,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#replyTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -8742,6 +10413,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -8893,6 +10568,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#replyTarget_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -8905,6 +10581,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -9330,6 +11010,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#location_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -9342,6 +11023,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -9493,6 +11178,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#location_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -9505,6 +11191,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -9929,6 +11619,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#preview_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -9941,6 +11632,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -10091,6 +11786,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#preview_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -10103,6 +11799,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -10526,6 +12226,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#replies_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -10538,6 +12239,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -10953,6 +12658,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#shares_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -10965,6 +12671,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -11380,6 +13090,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#likes_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -11392,6 +13103,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -11801,6 +13516,7 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#emojiReactions_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -11813,6 +13529,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -12283,6 +14003,7 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#tag_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -12295,6 +14016,10 @@ get summaries(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -12739,6 +14464,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#to_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -12751,6 +14477,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -12902,6 +14632,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#to_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -12914,6 +14645,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -13324,6 +15059,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#bto_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -13336,6 +15072,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -13487,6 +15227,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#bto_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -13499,6 +15240,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -13909,6 +15654,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#cc_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -13921,6 +15667,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -14072,6 +15822,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#cc_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -14084,6 +15835,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -14494,6 +16249,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#bcc_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -14506,6 +16262,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -14657,6 +16417,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#bcc_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -14669,6 +16430,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -15142,6 +16907,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#proof_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -15154,6 +16920,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -15304,6 +17074,7 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#proof_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -15316,6 +17087,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -15765,6 +17540,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#likeAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -15777,6 +17553,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -16186,6 +17966,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#replyAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -16198,6 +17979,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -16607,6 +18392,7 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#announceAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -16619,6 +18405,10 @@ get urls(): ((URL | Link))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -17536,8 +19326,21 @@ get licenses(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Link ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17556,8 +19359,29 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17576,8 +19400,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17596,6 +19425,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -17619,8 +19449,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17639,6 +19478,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -17662,6 +19502,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#dateTime", @@ -17685,8 +19526,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17705,8 +19555,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17725,8 +19580,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17745,8 +19605,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17765,8 +19634,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17785,8 +19663,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Link ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17805,6 +19692,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#dateTime", @@ -17828,8 +19716,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_7UpwM3JWcXhADcscukEehBorf6k_replies) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17848,8 +19741,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17868,8 +19766,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17888,8 +19791,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17908,6 +19816,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#dateTime", @@ -17931,6 +19840,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -17954,8 +19864,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -17974,6 +19893,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#dateTime", @@ -17997,8 +19917,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + let element = ( - v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18017,8 +19942,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18037,8 +19967,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18057,8 +19992,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18077,8 +20017,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18097,6 +20042,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + let element = ( { "@value": v } ); @@ -18117,6 +20063,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#duration", @@ -18140,6 +20087,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive) { + let element = ( { "@value": v } ); @@ -18160,8 +20108,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18180,8 +20133,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18200,8 +20158,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18220,6 +20183,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { + let element = ( { "@id": formatIri(v) } ); @@ -18240,8 +20204,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18260,8 +20229,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18280,8 +20254,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18300,8 +20279,13 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -18320,6 +20304,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + let element = ( { "@id": formatIri(v) } ); @@ -18441,6 +20426,8 @@ get licenses(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -18874,16 +20861,31 @@ get licenses(): (URL)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("http://schema.org#PropertyValue") ? await PropertyValue.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -18925,23 +20927,48 @@ get licenses(): (URL)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -18982,7 +21009,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19058,12 +21090,22 @@ get licenses(): (URL)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19172,12 +21214,22 @@ get licenses(): (URL)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19241,7 +21293,12 @@ get licenses(): (URL)[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19305,7 +21362,12 @@ get licenses(): (URL)[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19348,12 +21410,22 @@ get licenses(): (URL)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19396,12 +21468,22 @@ get licenses(): (URL)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19444,12 +21526,22 @@ get licenses(): (URL)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19523,7 +21615,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19564,7 +21661,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19605,7 +21707,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19646,7 +21753,12 @@ get licenses(): (URL)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19755,12 +21867,22 @@ get licenses(): (URL)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19829,7 +21951,12 @@ get licenses(): (URL)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -19870,7 +21997,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19911,7 +22043,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19952,7 +22089,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -19993,7 +22135,12 @@ get licenses(): (URL)[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20113,7 +22260,12 @@ get licenses(): (URL)[] { const decoded = await Source.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20159,7 +22311,12 @@ get licenses(): (URL)[] { const decoded = await DataIntegrityProof.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20191,7 +22348,12 @@ get licenses(): (URL)[] { const decoded = await InteractionPolicy.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20261,7 +22423,12 @@ get licenses(): (URL)[] { const decoded = await LikeAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20302,7 +22469,12 @@ get licenses(): (URL)[] { const decoded = await ReplyAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20343,7 +22515,12 @@ get licenses(): (URL)[] { const decoded = await AnnounceAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20375,7 +22552,12 @@ get licenses(): (URL)[] { const decoded = await Translation.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -20429,6 +22611,16 @@ get licenses(): (URL)[] { } instance.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = _2rzkBRS4gNPrkJk9DohHAMUAxA2d; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Object.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -21453,6 +23645,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -21518,9 +23714,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -21708,6 +23905,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -21840,6 +24039,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Emoji)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -21847,6 +24049,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Emoji.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -22019,6 +24231,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -22132,9 +24348,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -22262,6 +24479,112 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/fep/044f#quote", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ChatMessage).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ChatMessage).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set("https://w3id.org/fep/044f#quote", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#quoteUrl", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ChatMessage).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ "@value": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ChatMessage).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#quoteUrl", descriptor); +descriptors.set("https://misskey-hub.net/ns#_misskey_quote", descriptor); +descriptors.set("http://fedibird.com/ns#quoteUri", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/044f#quoteAuthorization", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ChatMessage).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ChatMessage).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set("https://w3id.org/fep/044f#quoteAuthorization", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchQuote( url: URL, @@ -22631,6 +24954,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -22643,6 +24967,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -23075,6 +25403,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -23087,6 +25416,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -23262,8 +25595,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -23282,6 +25620,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { "@value": formatIri(v) } ); @@ -23306,8 +25645,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -23392,6 +25736,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://schema.org/license","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -23524,6 +25870,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ChatMessage)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -23555,7 +25904,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -23635,7 +25989,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -23652,6 +26011,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ChatMessage.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -24234,6 +26603,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -24707,9 +27080,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -24909,6 +27283,232 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#actor", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#actor", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#object", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#object", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#target", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#target", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#result", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#result", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#origin", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_25zu2s3VxVujgEKqrDycjE284XQR_origin) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_25zu2s3VxVujgEKqrDycjE284XQR_origin; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#origin", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#instrument", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Activity).#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Activity).#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#instrument", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchActor( url: URL, @@ -25338,6 +27938,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#actor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -25350,6 +27951,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -25502,6 +28107,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#actor_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -25514,6 +28120,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -25925,6 +28535,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#object_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -25937,6 +28548,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -26089,6 +28704,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#object_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -26101,6 +28717,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -26515,6 +29135,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#target_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -26527,6 +29148,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -26682,6 +29307,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#target_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -26694,6 +29320,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -27105,6 +29735,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#result_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -27117,6 +29748,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -27269,6 +29904,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#result_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -27281,6 +29917,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -27693,6 +30333,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#origin_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -27705,6 +30346,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -27858,6 +30503,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#origin_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -27870,6 +30516,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -28280,6 +30930,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#instrument_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -28292,6 +30943,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -28443,6 +31098,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#instrument_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -28455,6 +31111,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -28546,8 +31206,29 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28566,8 +31247,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28586,8 +31272,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28606,8 +31297,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28626,8 +31322,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28646,8 +31347,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -28732,6 +31438,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -29004,6 +31712,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Activity)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -29036,23 +31747,48 @@ const base = getDeepCloneDescriptor(this.prototype)!; typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -29093,7 +31829,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29134,7 +31875,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29175,7 +31921,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29216,7 +31967,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29257,7 +32013,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -29274,6 +32035,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Activity.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -29558,6 +32329,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -29629,9 +32404,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -29806,6 +32582,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -29938,6 +32716,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof EmojiReact)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -29945,6 +32726,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + EmojiReact.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -30005,7 +32796,7 @@ instruments?: (Object | URL)[];} }; /** A pair of property name and value. */ -export class PropertyValue { +export class PropertyValue implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -30021,6 +32812,14 @@ export class PropertyValue { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -30166,6 +32965,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -30205,6 +33008,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if ("name" in values && values.name != null) { @@ -30250,9 +33054,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -30308,6 +33113,94 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: PropertyValue, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#name", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as PropertyValue).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as PropertyValue).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#name", descriptor); + + descriptor = { + canonicalIri: "http://schema.org#value", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as PropertyValue).#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as PropertyValue).#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value; + }, + }; + descriptors.set("http://schema.org#value", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The name of a property. */ @@ -30424,6 +33317,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -30447,6 +33341,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -30535,6 +33430,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://schema.org#value","https://www.w3.org/ns/activitystreams#name"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -30736,6 +33633,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value = _2cSy2magg4iZ7zLaG8U7DiJMoCkx_value; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + PropertyValue.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -30851,7 +33758,7 @@ deepCloneDescriptors.set(this.prototype, { }; /** A quantity with a unit of measure. */ -export class Measure { +export class Measure implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -30867,6 +33774,14 @@ export class Measure { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -31012,6 +33927,10 @@ unit?: string | null;numericalValue?: Decimal | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -31051,6 +33970,7 @@ unit?: string | null;numericalValue?: Decimal | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.length < vocabSparseArrayMinimumLength ? this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.slice() : vocabCopyPropertyArray(this.#_27fgyFbosTtMAhuepJH8K3ZGURT6); if ("unit" in values && values.unit != null) { @@ -31096,9 +34016,10 @@ unit?: string | null;numericalValue?: Decimal | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -31154,6 +34075,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Measure, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Measure).#_27fgyFbosTtMAhuepJH8K3ZGURT6) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Measure).#_27fgyFbosTtMAhuepJH8K3ZGURT6; + }, + }; + descriptors.set("http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit", descriptor); + + descriptor = { + canonicalIri: "http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Measure).#_1GQx8o2RgxRs4x9G5uT39XYBv7D) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#decimal", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Measure).#_1GQx8o2RgxRs4x9G5uT39XYBv7D; + }, + }; + descriptors.set("http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The name of the unit, according to the Ontology of units of Measure * classification. The recommended unit for countable items is \`"one"\`. @@ -31268,6 +34274,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_27fgyFbosTtMAhuepJH8K3ZGURT6) { + let element = ( { "@value": v } ); @@ -31288,6 +34295,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#decimal", @@ -31366,6 +34374,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue","http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -31560,6 +34570,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = _1GQx8o2RgxRs4x9G5uT39XYBv7D; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Measure.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -31777,6 +34797,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -31876,9 +34900,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -31984,6 +35009,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactingObject", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as AnnounceAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as AnnounceAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactionTarget", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as AnnounceAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as AnnounceAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -32352,6 +35451,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -32364,6 +35464,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -32772,6 +35876,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -32784,6 +35889,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -32933,8 +36042,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -32953,8 +36067,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -33039,6 +36158,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -33171,6 +36292,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof AnnounceAuthorization)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -33202,7 +36326,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -33243,7 +36372,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -33260,6 +36394,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + AnnounceAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -33438,6 +36582,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -33509,9 +36657,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -33686,6 +36835,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -33818,6 +36969,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof AnnounceRequest)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -33825,6 +36979,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + AnnounceRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -33892,7 +37056,7 @@ instruments?: (Object | URL)[];} * for details. * */ -export class InteractionPolicy { +export class InteractionPolicy implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -33908,6 +37072,14 @@ export class InteractionPolicy { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -34095,6 +37267,10 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -34134,6 +37310,7 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature = this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length < vocabSparseArrayMinimumLength ? this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.slice() : vocabCopyPropertyArray(this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature); if ("canFeature" in values && values.canFeature != null) { @@ -34221,9 +37398,10 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -34389,6 +37567,198 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: InteractionPolicy, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/fep/7aa9#canFeature", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature; + }, + }; + descriptors.set("https://w3id.org/fep/7aa9#canFeature", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#canLike", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike; + }, + }; + descriptors.set("https://gotosocial.org/ns#canLike", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#canReply", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply; + }, + }; + descriptors.set("https://gotosocial.org/ns#canReply", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#canAnnounce", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce; + }, + }; + descriptors.set("https://gotosocial.org/ns#canAnnounce", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#canQuote", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionPolicy).#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionPolicy).#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; + }, + }; + descriptors.set("https://gotosocial.org/ns#canQuote", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The sub-policy specifying who can feature the actor in a * {@link FeaturedCollection}. @@ -34513,8 +37883,13 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34533,8 +37908,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34553,8 +37933,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34573,8 +37958,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34593,8 +37983,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -34693,6 +38088,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://gotosocial.org/ns#canAnnounce","https://gotosocial.org/ns#canLike","https://gotosocial.org/ns#canQuote","https://gotosocial.org/ns#canReply","https://w3id.org/fep/7aa9#canFeature"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -34843,7 +38240,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34875,7 +38277,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34907,7 +38314,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34939,7 +38351,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34971,7 +38388,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -34988,6 +38410,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote = _LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + InteractionPolicy.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -35181,7 +38613,7 @@ deepCloneDescriptors.set(this.prototype, { * for details. * */ -export class InteractionRule { +export class InteractionRule implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -35197,6 +38629,14 @@ export class InteractionRule { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -35438,6 +38878,10 @@ manualApprovals?: (URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -35479,6 +38923,7 @@ manualApprovals?: (URL)[];} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length < vocabSparseArrayMinimumLength ? this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.slice() : vocabCopyPropertyArray(this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval); if ("automaticApproval" in values && values.automaticApproval != null) { @@ -35618,9 +39063,10 @@ manualApprovals?: (URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -35722,6 +39168,88 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: InteractionRule, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#automaticApproval", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionRule).#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionRule).#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval; + }, + }; + descriptors.set("https://gotosocial.org/ns#automaticApproval", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#manualApproval", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as InteractionRule).#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as InteractionRule).#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; + }, + }; + descriptors.set("https://gotosocial.org/ns#manualApproval", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** URIs of actors or collections whose interactions are automatically * approved without requiring manual review by the post author. @@ -35809,6 +39337,7 @@ get manualApprovals(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval) { + let element = ( { "@id": formatIri(v) } ); @@ -35829,6 +39358,7 @@ get manualApprovals(): (URL)[] { array = []; for (const v of this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval) { + let element = ( { "@id": formatIri(v) } ); @@ -35904,6 +39434,8 @@ get manualApprovals(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#manualApproval"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -36097,6 +39629,16 @@ get manualApprovals(): (URL)[] { } instance.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = _sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + InteractionRule.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -36325,6 +39867,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -36424,9 +39970,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -36532,6 +40079,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactingObject", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as LikeAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as LikeAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactionTarget", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as LikeAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as LikeAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -36900,6 +40521,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -36912,6 +40534,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -37320,6 +40946,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -37332,6 +40959,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -37481,8 +41112,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -37501,8 +41137,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -37587,6 +41228,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -37719,6 +41362,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof LikeAuthorization)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -37750,7 +41396,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -37791,7 +41442,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -37808,6 +41464,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + LikeAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -37985,6 +41651,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -38056,9 +41726,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -38233,6 +41904,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -38365,6 +42038,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof LikeRequest)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -38372,6 +42048,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + LikeRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -38533,6 +42219,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -38632,9 +42322,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -38740,6 +42431,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactingObject", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ReplyAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ReplyAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactionTarget", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ReplyAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as ReplyAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -39108,6 +42873,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -39120,6 +42886,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -39528,6 +43298,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -39540,6 +43311,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -39689,8 +43464,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -39709,8 +43489,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -39795,6 +43580,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -39927,6 +43714,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ReplyAuthorization)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -39958,7 +43748,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -39999,7 +43794,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -40016,6 +43816,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ReplyAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -40193,6 +44003,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -40264,9 +44078,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -40441,6 +44256,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -40573,6 +44390,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ReplyRequest)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -40580,6 +44400,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ReplyRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -40741,6 +44571,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -40840,9 +44674,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -40948,6 +44783,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactingObject", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as QuoteAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as QuoteAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactionTarget", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as QuoteAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as QuoteAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -41315,6 +45224,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -41327,6 +45237,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -41735,6 +45649,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -41747,6 +45662,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -41896,8 +45815,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -41916,8 +45840,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -42002,6 +45931,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -42134,6 +46065,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof QuoteAuthorization)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -42165,7 +46099,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -42206,7 +46145,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -42223,6 +46167,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + QuoteAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -42400,6 +46354,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -42471,9 +46429,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -42648,6 +46607,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -42780,6 +46741,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof QuoteRequest)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -42787,6 +46751,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + QuoteRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -42854,7 +46828,7 @@ instruments?: (Object | URL)[];} * Targets [draft revision 6d0d6559](https://codeberg.org/fediverse/fep/src/commit/6d0d6559054baeb7b71a5f2bdc14fc4c09b66f39/fep/22cd/fep-22cd.md). * */ -export class Translation { +export class Translation implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -42870,6 +46844,14 @@ export class Translation { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -43171,6 +47153,10 @@ urls?: ((URL | Link))[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -43212,6 +47198,7 @@ urls?: ((URL | Link))[];} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.length < vocabSparseArrayMinimumLength ? this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.slice() : vocabCopyPropertyArray(this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG); if ("language" in values && values.language != null) { @@ -43413,9 +47400,10 @@ urls?: ((URL | Link))[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -43561,6 +47549,235 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Translation, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://schema.org/inLanguage", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_diXuPmFWiEqfLPhhrxg6Xc7ixZG) { + + let element = ( +{ "@value": v.baseName } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_diXuPmFWiEqfLPhhrxg6Xc7ixZG; + }, + }; + descriptors.set("https://schema.org/inLanguage", descriptor); + + descriptor = { + canonicalIri: "https://schema.org/translator", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; + }, + }; + descriptors.set("https://schema.org/translator", descriptor); + + descriptor = { + canonicalIri: "https://schema.org/translationOfWork", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_Msz9PwRg7cWkiXPL4ixyQLtuuH7) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_Msz9PwRg7cWkiXPL4ixyQLtuuH7; + }, + }; + descriptors.set("https://schema.org/translationOfWork", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/22cd#sourceUpdated", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated; + }, + }; + descriptors.set("https://w3id.org/fep/22cd#sourceUpdated", descriptor); + + descriptor = { + canonicalIri: "https://schema.org/isBasedOn", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_4KvkQNz1JjGs8S7iJDcGrUYETbUW) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_4KvkQNz1JjGs8S7iJDcGrUYETbUW; + }, + }; + descriptors.set("https://schema.org/isBasedOn", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#url", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Translation).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + + let element = ( +v instanceof URL ?{ "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Translation).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#url", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The translated language. Publishers must match a language in the * containing object's content, name, or summary map. @@ -44008,6 +48225,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#translator_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -44020,6 +48238,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -44175,6 +48397,7 @@ deepCloneDescriptors.set(this.prototype, { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#translator_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -44187,6 +48410,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -44469,6 +48696,7 @@ get urls(): ((URL | Link))[] { const values: Record = {}; array = []; for (const v of this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG) { + let element = ( { "@value": v.baseName } ); @@ -44489,8 +48717,29 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -44509,6 +48758,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7) { + let element = ( { "@id": formatIri(v) } ); @@ -44529,6 +48779,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#dateTime", @@ -44552,6 +48803,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW) { + let element = ( { "@id": formatIri(v) } ); @@ -44572,8 +48824,13 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { + let element = ( - v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -44652,6 +48909,8 @@ get urls(): ((URL | Link))[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://schema.org/inLanguage","https://schema.org/isBasedOn","https://schema.org/translationOfWork","https://schema.org/translator","https://w3id.org/fep/22cd#sourceUpdated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -44841,23 +49100,48 @@ get urls(): ((URL | Link))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -44984,7 +49268,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -45001,6 +49290,16 @@ get urls(): ((URL | Link))[] { } instance.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = _2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Translation.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -45305,6 +49604,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -45404,9 +49707,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -45512,6 +49816,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactingObject", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeatureAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeatureAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); + + descriptor = { + canonicalIri: "https://gotosocial.org/ns#interactionTarget", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeatureAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeatureAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + }, + }; + descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchInteractingObject( url: URL, @@ -45878,6 +50256,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactingObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -45890,6 +50269,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -46297,6 +50680,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#interactionTarget_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -46309,6 +50693,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -46458,8 +50846,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -46478,8 +50871,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -46564,6 +50962,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -46696,6 +51096,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeatureAuthorization)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -46727,7 +51130,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -46768,7 +51176,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -46785,6 +51198,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeatureAuthorization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -46959,6 +51382,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -47030,9 +51457,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -47207,6 +51635,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -47339,6 +51769,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeatureRequest)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -47346,6 +51779,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeatureRequest.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -47706,6 +52149,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -48017,9 +52464,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -48345,6 +52793,457 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#totalItems", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#totalItems", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#current", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_3UyUdxnyn6cDn53QKrh4MBiearma_current; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#current", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#first", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_J52RqweMe6hhv7RnLJMC8BExTE5_first; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#first", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#last", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#last", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#items", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#items", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/5711#likesOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; + }, + }; + descriptors.set("https://w3id.org/fep/5711#likesOf", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/5711#sharesOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; + }, + }; + descriptors.set("https://w3id.org/fep/5711#sharesOf", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/5711#repliesOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; + }, + }; + descriptors.set("https://w3id.org/fep/5711#repliesOf", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/5711#inboxOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; + }, + }; + descriptors.set("https://w3id.org/fep/5711#inboxOf", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/5711#outboxOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; + }, + }; + descriptors.set("https://w3id.org/fep/5711#outboxOf", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/5711#followersOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; + }, + }; + descriptors.set("https://w3id.org/fep/5711#followersOf", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/5711#followingOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; + }, + }; + descriptors.set("https://w3id.org/fep/5711#followingOf", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/5711#likedOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Collection).#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Collection).#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; + }, + }; + descriptors.set("https://w3id.org/fep/5711#likedOf", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A non-negative integer specifying the total number of objects contained by * the logical view of the collection. This number might not reflect the actual @@ -48729,6 +53628,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#current_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -48741,6 +53641,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -49150,6 +54054,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#first_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -49162,6 +54067,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -49571,6 +54480,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#last_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -49583,6 +54493,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -50011,6 +54925,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#item_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -50023,6 +54938,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -50432,6 +55351,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#likesOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -50444,6 +55364,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -50852,6 +55776,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#sharesOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -50864,6 +55789,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -51272,6 +56201,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#repliesOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -51284,6 +56214,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -51692,6 +56626,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#inboxOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -51704,6 +56639,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -52112,6 +57051,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#outboxOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -52124,6 +57064,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -52532,6 +57476,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#followersOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -52544,6 +57489,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -52952,6 +57901,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#followingOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -52964,6 +57914,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -53372,6 +58326,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#likedOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -53384,6 +58339,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -53753,6 +58712,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -53776,8 +58736,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53796,8 +58761,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53816,8 +58786,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53836,8 +58811,17 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53856,8 +58840,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53876,8 +58865,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53896,8 +58890,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53916,8 +58915,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53936,8 +58940,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53956,8 +58965,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53976,8 +58990,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -53996,8 +59015,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -54082,6 +59106,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#totalItems","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -54230,6 +59256,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Collection)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -54290,7 +59319,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54331,7 +59365,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54372,7 +59411,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54415,12 +59459,22 @@ const base = getDeepCloneDescriptor(this.prototype)!; && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -54461,7 +59515,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54502,7 +59561,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54543,7 +59607,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54584,7 +59653,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54625,7 +59699,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54666,7 +59745,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54707,7 +59791,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54748,7 +59837,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -54765,6 +59859,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Collection.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -55194,6 +60298,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -55304,9 +60412,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -55390,6 +60499,50 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#items", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as OrderedCollection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { "@list": array }; + }, + values(object: object): readonly unknown[] { + return (object as OrderedCollection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#items", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchItem( url: URL, @@ -55777,6 +60930,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#item_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -55789,6 +60943,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -55920,8 +61078,17 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -56006,6 +61173,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#totalItems","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -56142,6 +61311,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof OrderedCollection)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -56175,12 +61347,22 @@ const base = getDeepCloneDescriptor(this.prototype)!; && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -56197,6 +61379,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + OrderedCollection.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -56371,6 +61563,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -56464,9 +61660,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -56550,6 +61747,76 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/fep/7aa9#topic", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedCollection).#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedCollection).#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic; + }, + }; + descriptors.set("https://w3id.org/fep/7aa9#topic", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#discoverable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedCollection).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedCollection).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A single {@link Hashtag} object that represents the main topic or category * of this featured collection. @@ -56685,8 +61952,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -56705,6 +61977,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { "@value": v } ); @@ -56791,6 +62064,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/fep/7aa9#topic","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#totalItems","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -56923,6 +62198,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeaturedCollection)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -56945,7 +62223,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Hashtag.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -56991,6 +62274,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = _gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeaturedCollection.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -57187,6 +62480,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -57286,9 +62583,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -57394,6 +62692,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/fep/7aa9#featuredObject", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedItem).#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedItem).#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; + }, + }; + descriptors.set("https://w3id.org/fep/7aa9#featuredObject", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/7aa9#featureAuthorization", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as FeaturedItem).#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as FeaturedItem).#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; + }, + }; + descriptors.set("https://w3id.org/fep/7aa9#featureAuthorization", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchFeaturedObject( url: URL, @@ -57760,6 +63132,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredObject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -57772,6 +63145,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -58181,6 +63558,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featureAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -58193,6 +63571,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -58342,8 +63724,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -58362,8 +63749,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -58448,6 +63840,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/7aa9#featureAuthorization","https://w3id.org/fep/7aa9#featuredObject","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -58580,6 +63974,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof FeaturedItem)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -58611,7 +64008,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -58652,7 +64054,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await FeatureAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -58669,6 +64076,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = _2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + FeaturedItem.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -58773,7 +64190,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; * and verifiable credential repository services. * */ -export class DidService { +export class DidService implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -58789,6 +64206,14 @@ export class DidService { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -58968,6 +64393,10 @@ endpoints?: (URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -59008,6 +64437,7 @@ endpoints?: (URL)[];} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length < vocabSparseArrayMinimumLength ? this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.slice() : vocabCopyPropertyArray(this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint); if ("endpoint" in values && values.endpoint != null) { @@ -59086,9 +64516,10 @@ endpoints?: (URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -59167,6 +64598,58 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: DidService, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/did#serviceEndpoint", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DidService).#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DidService).#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; + }, + }; + descriptors.set("https://www.w3.org/ns/did#serviceEndpoint", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A network address, such as an HTTP URL, at which services operate on behalf * of a DID subject. @@ -59229,6 +64712,7 @@ get endpoints(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint) { + let element = ( { "@id": formatIri(v) } ); @@ -59304,6 +64788,8 @@ get endpoints(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://www.w3.org/ns/did#serviceEndpoint"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -59472,6 +64958,16 @@ get endpoints(): (URL)[] { } instance.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + DidService.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -59620,6 +65116,10 @@ endpoints?: (URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -59670,9 +65170,10 @@ endpoints?: (URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -59815,6 +65316,8 @@ endpoints?: (URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://www.w3.org/ns/did#serviceEndpoint"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -59947,6 +65450,9 @@ endpoints?: (URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Export)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -59954,6 +65460,16 @@ endpoints?: (URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Export.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -60016,7 +65532,7 @@ endpoints?: (URL)[];} * verify the identity of the actor and the integrity of the data. * */ -export class DataIntegrityProof { +export class DataIntegrityProof implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -60032,6 +65548,14 @@ export class DataIntegrityProof { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -60223,6 +65747,10 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -60262,6 +65790,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.length < vocabSparseArrayMinimumLength ? this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.slice() : vocabCopyPropertyArray(this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite); if ("cryptosuite" in values && values.cryptosuite != null) { @@ -60354,9 +65883,10 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -60456,6 +65986,190 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: DataIntegrityProof, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/security#cryptosuite", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite; + }, + }; + descriptors.set("https://w3id.org/security#cryptosuite", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#verificationMethod", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod; + }, + }; + descriptors.set("https://w3id.org/security#verificationMethod", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#proofPurpose", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose) { + + let element = ( +{ + "@id": "https://w3id.org/security#" + v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose; + }, + }; + descriptors.set("https://w3id.org/security#proofPurpose", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#proofValue", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue) { + + let element = ( +{ + "@type": "https://w3id.org/security#multibase", + "@value": new TextDecoder().decode(encodeMultibase("base58btc", v)), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue; + }, + }; + descriptors.set("https://w3id.org/security#proofValue", descriptor); + + descriptor = { + canonicalIri: "http://purl.org/dc/terms/created", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as DataIntegrityProof).#_3qzP3ukEZoUziK5FEiA1RhU4aqac) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as DataIntegrityProof).#_3qzP3ukEZoUziK5FEiA1RhU4aqac; + }, + }; + descriptors.set("http://purl.org/dc/terms/created", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The cryptographic suite used to create the proof. * @@ -60944,6 +66658,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite) { + let element = ( { "@value": v } ); @@ -60964,8 +66679,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -60984,6 +66704,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose) { + let element = ( { "@id": "https://w3id.org/security#" + v, @@ -61006,6 +66727,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue) { + let element = ( { "@type": "https://w3id.org/security#multibase", @@ -61029,6 +66751,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#dateTime", @@ -61107,6 +66830,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://purl.org/dc/terms/created","https://w3id.org/security#cryptosuite","https://w3id.org/security#proofPurpose","https://w3id.org/security#proofValue","https://w3id.org/security#verificationMethod"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -61295,7 +67020,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -61403,6 +67133,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = _3qzP3ukEZoUziK5FEiA1RhU4aqac; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + DataIntegrityProof.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -61578,7 +67318,7 @@ deepCloneDescriptors.set(this.prototype, { }; /** A key owned by an actor. */ -export class CryptographicKey { +export class CryptographicKey implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -61594,6 +67334,14 @@ export class CryptographicKey { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -61744,6 +67492,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -61783,6 +67535,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < vocabSparseArrayMinimumLength ? this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.slice() : vocabCopyPropertyArray(this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner);clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = vocabCopyTrustSet( this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, @@ -61834,9 +67587,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -61914,6 +67668,108 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: CryptographicKey, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/security#owner", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CryptographicKey).#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CryptographicKey).#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner; + }, + }; + descriptors.set("https://w3id.org/security#owner", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#publicKeyPem", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CryptographicKey).#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem) { + + let element = ( +{ "@value": await exportSpki(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CryptographicKey).#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem; + }, + }; + descriptors.set("https://w3id.org/security#publicKeyPem", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchOwner( url: URL, @@ -62340,6 +68196,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#owner_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -62352,6 +68209,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -62510,8 +68371,29 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -62530,6 +68412,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem) { + let element = ( { "@value": await exportSpki(v) } ); @@ -62605,6 +68488,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://w3id.org/security#owner","https://w3id.org/security#publicKeyPem"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -62765,23 +68650,48 @@ deepCloneDescriptors.set(this.prototype, { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -62827,6 +68737,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = _2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + CryptographicKey.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -62946,7 +68866,7 @@ deepCloneDescriptors.set(this.prototype, { * [1]: https://w3id.org/fep/521a * */ -export class Multikey { +export class Multikey implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -62962,6 +68882,14 @@ export class Multikey { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -63112,6 +69040,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -63151,6 +69083,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < vocabSparseArrayMinimumLength ? this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.slice() : vocabCopyPropertyArray(this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller);clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = vocabCopyTrustSet( this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, @@ -63202,9 +69135,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -63282,6 +69216,111 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Multikey, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/security#controller", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Multikey).#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Multikey).#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller; + }, + }; + descriptors.set("https://w3id.org/security#controller", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#publicKeyMultibase", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Multikey).#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase) { + + let element = ( +{ + "@type": "https://w3id.org/security#multibase", + "@value": await exportMultibaseKey(v), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Multikey).#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase; + }, + }; + descriptors.set("https://w3id.org/security#publicKeyMultibase", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchController( url: URL, @@ -63708,6 +69747,7 @@ deepCloneDescriptors.set(this.prototype, { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#controller_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -63720,6 +69760,10 @@ deepCloneDescriptors.set(this.prototype, { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -63882,8 +69926,29 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -63902,6 +69967,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase) { + let element = ( { "@type": "https://w3id.org/security#multibase", @@ -63980,6 +70046,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://w3id.org/security#controller","https://w3id.org/security#publicKeyMultibase"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -64140,23 +70208,48 @@ deepCloneDescriptors.set(this.prototype, { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -64202,6 +70295,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase = _4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Multikey.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -64418,6 +70521,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -64511,9 +70618,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -64619,6 +70727,80 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#stipulates", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Agreement).#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Agreement).#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#stipulates", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#stipulatesReciprocal", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Agreement).#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Agreement).#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#stipulatesReciprocal", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The primary {@link Commitment} associated with the agreement. This * commitment satisfies the primary {@link Intent} of the corresponding @@ -64759,8 +70941,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -64779,8 +70966,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -64865,6 +71057,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://w3id.org/valueflows/ont/vf#stipulates","https://w3id.org/valueflows/ont/vf#stipulatesReciprocal","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -64997,6 +71191,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Agreement)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -65019,7 +71216,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Commitment.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -65051,7 +71253,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Commitment.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -65068,6 +71275,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal = _4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Agreement.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -65172,7 +71389,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; * specifies the actual amount of the economic resource being committed. * */ -export class Commitment { +export class Commitment implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -65188,6 +71405,14 @@ export class Commitment { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -65333,6 +71558,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -65372,6 +71601,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies = this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length < vocabSparseArrayMinimumLength ? this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.slice() : vocabCopyPropertyArray(this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies); if ("satisfies" in values && values.satisfies != null) { @@ -65417,9 +71647,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -65519,6 +71750,92 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Commitment, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#satisfies", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Commitment).#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Commitment).#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#satisfies", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#resourceQuantity", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Commitment).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Commitment).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#resourceQuantity", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The {@link Intent} of a {@link Proposal} that this commitment * satisfies. The value is the proposal's URI with a @@ -65641,6 +71958,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { + let element = ( { "@id": formatIri(v) } ); @@ -65661,8 +71979,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -65736,6 +72059,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://w3id.org/valueflows/ont/vf#resourceQuantity","https://w3id.org/valueflows/ont/vf#satisfies"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -65915,7 +72240,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -65932,6 +72262,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Commitment.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -66049,7 +72389,7 @@ deepCloneDescriptors.set(this.prototype, { * in a {@link Proposal}. * */ -export class Intent { +export class Intent implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -66065,6 +72405,14 @@ export class Intent { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -66252,6 +72600,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -66291,6 +72643,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length < vocabSparseArrayMinimumLength ? this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.slice() : vocabCopyPropertyArray(this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action); if ("action" in values && values.action != null) { @@ -66378,9 +72731,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -66524,6 +72878,190 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Intent, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#action", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#action", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#resourceConformsTo", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#resourceConformsTo", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#resourceQuantity", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#resourceQuantity", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#availableQuantity", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#availableQuantity", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#minimumQuantity", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Intent).#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Intent).#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#minimumQuantity", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The type of economic transaction. The value of this property should be * either \`"deliverService"\` or \`"transfer"\`. @@ -66739,6 +73277,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) { + let element = ( { "@value": v } ); @@ -66759,6 +73298,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { + let element = ( { "@id": formatIri(v) } ); @@ -66779,8 +73319,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -66799,8 +73344,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -66819,8 +73369,13 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -66894,6 +73449,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://w3id.org/valueflows/ont/vf#action","https://w3id.org/valueflows/ont/vf#availableQuantity","https://w3id.org/valueflows/ont/vf#minimumQuantity","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#resourceQuantity"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -67103,7 +73660,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -67135,7 +73697,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -67167,7 +73734,12 @@ deepCloneDescriptors.set(this.prototype, { const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -67184,6 +73756,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Intent.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -67488,6 +74070,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -67609,9 +74195,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -67717,6 +74304,140 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#purpose", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#purpose", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#publishes", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#publishes", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#reciprocal", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#reciprocal", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/valueflows/ont/vf#unitBased", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Proposal).#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Proposal).#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased; + }, + }; + descriptors.set("https://w3id.org/valueflows/ont/vf#unitBased", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The type of proposal. Possible values are \`"offer"\` and \`"request"\`. * @@ -67916,6 +74637,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) { + let element = ( { "@value": v } ); @@ -67936,8 +74658,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -67956,8 +74683,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -67976,6 +74708,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) { + let element = ( { "@value": v } ); @@ -68062,6 +74795,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://w3id.org/valueflows/ont/vf#publishes","https://w3id.org/valueflows/ont/vf#purpose","https://w3id.org/valueflows/ont/vf#reciprocal","https://w3id.org/valueflows/ont/vf#unitBased","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -68194,6 +74929,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Proposal)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -68246,7 +74984,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -68278,7 +75021,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -68324,6 +75072,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Proposal.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -68534,6 +75292,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -68605,9 +75367,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -68782,6 +75545,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -68918,6 +75683,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Accept)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -68925,6 +75693,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Accept.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -69056,6 +75834,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -69127,9 +75909,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -69304,6 +76087,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -69436,6 +76221,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Add)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -69443,6 +76231,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Add.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -69573,6 +76371,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -69644,9 +76446,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -69821,6 +76624,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -69953,6 +76758,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Announce)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -69960,6 +76768,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Announce.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -70823,6 +77641,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -71648,9 +78470,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -72092,6 +78915,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#preferredUsername", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#publicKey", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set("https://w3id.org/security#publicKey", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#assertionMethod", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set("https://w3id.org/security#assertionMethod", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/ef61/gateways", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ "@id": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { "@list": array }; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); + + descriptor = { + canonicalIri: "http://www.w3.org/ns/ldp#inbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#outbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#following", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#followers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#liked", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featured", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featured", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featuredTags", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/7aa9#featuredCollections", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#streams", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#endpoints", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#discoverable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#suspended", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#memorial", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#indexable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#alsoKnownAs", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/did#service", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set("https://www.w3.org/ns/did#service", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#_misskey_followedMessage", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#isCat", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/6757#preferredLicense", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -72481,6 +80163,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -72493,6 +80176,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -72642,6 +80329,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -72654,6 +80342,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -73066,6 +80758,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -73078,6 +80771,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -73231,6 +80928,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -73243,6 +80941,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -73725,6 +81427,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -73737,6 +81440,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -74169,6 +81876,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -74181,6 +81889,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -74593,6 +82305,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -74605,6 +82318,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -75020,6 +82737,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -75032,6 +82750,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -75445,6 +83167,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -75457,6 +83180,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -75868,6 +83595,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -75880,6 +83608,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -76291,6 +84023,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -76303,6 +84036,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -76711,6 +84448,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -76723,6 +84461,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -77135,6 +84877,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -77147,6 +84890,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -77701,6 +85448,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -77713,6 +85461,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -78184,6 +85936,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -78196,6 +85949,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -78349,6 +86106,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -78361,6 +86119,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -78773,6 +86535,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -78785,6 +86548,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -78938,6 +86705,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -78950,6 +86718,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -79626,6 +87398,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -79649,8 +87422,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79669,8 +87447,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79689,6 +87472,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { "@id": v.origin } ); @@ -79709,6 +87493,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { "@value": v } ); @@ -79729,8 +87514,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79749,8 +87543,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79769,8 +87572,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79789,8 +87597,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79809,8 +87622,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79829,8 +87647,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79849,8 +87672,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79869,8 +87697,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79889,8 +87722,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79909,8 +87747,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -79929,6 +87772,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { "@value": v } ); @@ -79949,6 +87793,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { "@value": v } ); @@ -79969,6 +87814,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { "@value": v } ); @@ -79989,6 +87835,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { "@value": v } ); @@ -80029,8 +87876,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -80049,8 +87917,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -80069,8 +87958,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -80089,6 +87983,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { "@value": v } ); @@ -80109,6 +88004,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { "@value": v } ); @@ -80129,6 +88025,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { "@id": formatIri(v) } ); @@ -80230,6 +88127,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -80362,6 +88261,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Application)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -80426,7 +88328,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80467,7 +88374,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80568,11 +88480,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -80615,11 +88537,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -80660,7 +88592,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80701,7 +88638,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80742,7 +88684,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80783,7 +88730,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80824,7 +88776,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80865,7 +88822,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80906,7 +88868,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -80938,7 +88905,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -81126,23 +89098,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -81184,23 +89181,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -81241,7 +89263,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -81346,6 +89373,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Application.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -82036,6 +90073,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -82107,9 +90148,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -82284,6 +90326,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -82428,6 +90472,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof IntransitiveActivity)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -82435,6 +90482,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + IntransitiveActivity.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -82565,6 +90622,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -82636,9 +90697,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -82813,6 +90875,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -82945,6 +91009,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Arrive)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -82952,6 +91019,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Arrive.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -83119,6 +91196,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -83232,9 +91313,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -83362,6 +91444,112 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/fep/044f#quote", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Article).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Article).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set("https://w3id.org/fep/044f#quote", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#quoteUrl", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Article).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ "@value": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Article).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#quoteUrl", descriptor); +descriptors.set("https://misskey-hub.net/ns#_misskey_quote", descriptor); +descriptors.set("http://fedibird.com/ns#quoteUri", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/044f#quoteAuthorization", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Article).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Article).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set("https://w3id.org/fep/044f#quoteAuthorization", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchQuote( url: URL, @@ -83731,6 +91919,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -83743,6 +91932,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -84175,6 +92368,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -84187,6 +92381,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -84362,8 +92560,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -84382,6 +92585,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { "@value": formatIri(v) } ); @@ -84406,8 +92610,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -84492,6 +92701,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://schema.org/license","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -84624,6 +92835,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Article)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -84655,7 +92869,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -84735,7 +92954,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -84752,6 +92976,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Article.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -84975,6 +93209,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -85082,9 +93320,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -85138,6 +93377,108 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; return deepCloneGraph(this, this.clone(values, cloneOptions)); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#width", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Document).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Document).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#width", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#height", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Document).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Document).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#height", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/credentials/v2#digestMultibase", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Document).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Document).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + }, + }; + descriptors.set("https://www.w3.org/ns/credentials/v2#digestMultibase", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** Specifies a hint as to the rendering width in * device-independent pixels of the linked resource. @@ -85301,6 +93642,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -85324,6 +93666,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -85347,6 +93690,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + let element = ( { "@value": v } ); @@ -85433,6 +93777,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#height","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/activitystreams#width","https://www.w3.org/ns/credentials/v2#digestMultibase"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -85581,6 +93927,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Document)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -85676,6 +94025,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } instance.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = _2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Document.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -85857,6 +94216,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -85922,9 +94285,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -86112,6 +94476,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#height","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/activitystreams#width","https://www.w3.org/ns/credentials/v2#digestMultibase"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -86244,6 +94610,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Audio)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -86251,6 +94620,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Audio.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -86380,6 +94759,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -86451,9 +94834,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -86628,6 +95012,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -86764,6 +95150,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Ignore)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -86771,6 +95160,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Ignore.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -86902,6 +95301,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -86973,9 +95376,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -87150,6 +95554,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -87282,6 +95688,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Block)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -87289,6 +95698,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Block.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -87461,6 +95880,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -87577,9 +96000,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -87707,6 +96131,114 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#partOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CollectionPage).#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CollectionPage).#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#partOf", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#next", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CollectionPage).#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CollectionPage).#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#next", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#prev", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as CollectionPage).#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as CollectionPage).#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#prev", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchPartOf( url: URL, @@ -88075,6 +96607,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#partOf_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -88087,6 +96620,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -88494,6 +97031,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#next_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -88506,6 +97044,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -88914,6 +97456,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#prev_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -88926,6 +97469,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -89095,8 +97642,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -89115,8 +97667,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -89135,8 +97692,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -89221,6 +97783,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#totalItems","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -89357,6 +97921,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof CollectionPage)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -89388,7 +97955,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -89429,7 +98001,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -89470,7 +98047,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -89487,6 +98069,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + CollectionPage.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -89674,6 +98266,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -89745,9 +98341,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -89922,6 +98519,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -90054,6 +98653,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Create)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -90061,6 +98663,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Create.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -90190,6 +98802,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -90261,9 +98877,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -90438,6 +99055,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -90570,6 +99189,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Delete)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -90577,6 +99199,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Delete.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -90704,6 +99336,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -90775,9 +99411,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -90952,6 +99589,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -91084,6 +99723,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Dislike)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -91091,6 +99733,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Dislike.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -91151,7 +99803,7 @@ instruments?: (Object | URL)[];} }; /** Contents of {@link Actor}'s \`endpoints\`. */ -export class Endpoints { +export class Endpoints implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -91167,6 +99819,14 @@ export class Endpoints { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -91382,6 +100042,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -91421,6 +100085,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length < vocabSparseArrayMinimumLength ? this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.slice() : vocabCopyPropertyArray(this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl); if ("proxyUrl" in values && values.proxyUrl != null) { @@ -91536,9 +100201,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -91748,6 +100414,238 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Endpoints, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#proxyUrl", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#proxyUrl", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#oauthTokenEndpoint", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#oauthTokenEndpoint", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#provideClientKey", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#provideClientKey", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#signClientKey", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#signClientKey", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#sharedInbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#sharedInbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#uploadMedia", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Endpoints).#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Endpoints).#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#uploadMedia", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** Endpoint URI so this actor's clients may access remote ActivityStreams * objects which require authentication to access. To use this endpoint, @@ -92038,6 +100936,7 @@ deepCloneDescriptors.set(this.prototype, { const values: Record = {}; array = []; for (const v of this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { + let element = ( { "@id": formatIri(v) } ); @@ -92058,6 +100957,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { + let element = ( { "@id": formatIri(v) } ); @@ -92078,6 +100978,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { + let element = ( { "@id": formatIri(v) } ); @@ -92098,6 +100999,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { + let element = ( { "@id": formatIri(v) } ); @@ -92118,6 +101020,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { + let element = ( { "@id": formatIri(v) } ); @@ -92138,6 +101041,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { + let element = ( { "@id": formatIri(v) } ); @@ -92158,6 +101062,7 @@ deepCloneDescriptors.set(this.prototype, { array = []; for (const v of this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia) { + let element = ( { "@id": formatIri(v) } ); @@ -92233,6 +101138,8 @@ deepCloneDescriptors.set(this.prototype, { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#uploadMedia"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -92571,6 +101478,16 @@ deepCloneDescriptors.set(this.prototype, { } instance.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia = _KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Endpoints.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -92847,6 +101764,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -92912,9 +101833,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -93102,6 +102024,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -93234,6 +102158,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Event)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -93241,6 +102168,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Event.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -93371,6 +102308,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -93442,9 +102383,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -93619,6 +102561,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -93751,6 +102695,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Flag)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -93758,6 +102705,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Flag.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -93889,6 +102846,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -93960,9 +102921,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -94137,6 +103099,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -94269,6 +103233,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Follow)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -94276,6 +103243,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Follow.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -95139,6 +104116,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -95964,9 +104945,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -96408,6 +105390,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#preferredUsername", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#publicKey", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set("https://w3id.org/security#publicKey", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#assertionMethod", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set("https://w3id.org/security#assertionMethod", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/ef61/gateways", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ "@id": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { "@list": array }; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); + + descriptor = { + canonicalIri: "http://www.w3.org/ns/ldp#inbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#outbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#following", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#followers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#liked", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featured", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featured", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featuredTags", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/7aa9#featuredCollections", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#streams", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#endpoints", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#discoverable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#suspended", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#memorial", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#indexable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#alsoKnownAs", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/did#service", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set("https://www.w3.org/ns/did#service", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#_misskey_followedMessage", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#isCat", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/6757#preferredLicense", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -96797,6 +106638,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -96809,6 +106651,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -96958,6 +106804,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -96970,6 +106817,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -97382,6 +107233,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -97394,6 +107246,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -97547,6 +107403,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -97559,6 +107416,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -98041,6 +107902,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -98053,6 +107915,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -98485,6 +108351,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -98497,6 +108364,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -98909,6 +108780,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -98921,6 +108793,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -99336,6 +109212,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -99348,6 +109225,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -99761,6 +109642,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -99773,6 +109655,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -100184,6 +110070,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -100196,6 +110083,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -100607,6 +110498,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -100619,6 +110511,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -101027,6 +110923,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -101039,6 +110936,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -101451,6 +111352,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -101463,6 +111365,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -102017,6 +111923,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -102029,6 +111936,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -102500,6 +112411,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -102512,6 +112424,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -102665,6 +112581,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -102677,6 +112594,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -103089,6 +113010,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -103101,6 +113023,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -103254,6 +113180,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -103266,6 +113193,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -103942,6 +113873,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -103965,8 +113897,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -103985,8 +113922,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104005,6 +113947,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { "@id": v.origin } ); @@ -104025,6 +113968,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { "@value": v } ); @@ -104045,8 +113989,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104065,8 +114018,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104085,8 +114047,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104105,8 +114072,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104125,8 +114097,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104145,8 +114122,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104165,8 +114147,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104185,8 +114172,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104205,8 +114197,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104225,8 +114222,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104245,6 +114247,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { "@value": v } ); @@ -104265,6 +114268,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { "@value": v } ); @@ -104285,6 +114289,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { "@value": v } ); @@ -104305,6 +114310,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { "@value": v } ); @@ -104345,8 +114351,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104365,8 +114392,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104385,8 +114433,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -104405,6 +114458,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { "@value": v } ); @@ -104425,6 +114479,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { "@value": v } ); @@ -104445,6 +114500,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { "@id": formatIri(v) } ); @@ -104546,6 +114602,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -104678,6 +114736,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Group)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -104742,7 +114803,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -104783,7 +114849,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -104884,11 +114955,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -104931,11 +115012,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -104976,7 +115067,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105017,7 +115113,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105058,7 +115159,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105099,7 +115205,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105140,7 +115251,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105181,7 +115297,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105222,7 +115343,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105254,7 +115380,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105442,23 +115573,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -105500,23 +115656,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -105557,7 +115738,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -105662,6 +115848,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Group.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -106290,7 +116486,7 @@ get attributionDomains(): (string)[] { * the resource. * */ -export class Link { +export class Link implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -106306,6 +116502,14 @@ export class Link { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -106715,6 +116919,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -106756,6 +116964,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length < vocabSparseArrayMinimumLength ? this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.slice() : vocabCopyPropertyArray(this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href); if ("href" in values && values.href != null) { @@ -107064,9 +117273,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -107190,6 +117400,347 @@ deepCloneDescriptors.set(this.prototype, { } } } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Link, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#href", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#href", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#rel", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#rel", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#mediaType", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#mediaType", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/credentials/v2#digestMultibase", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; + }, + }; + descriptors.set("https://www.w3.org/ns/credentials/v2#digestMultibase", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#name", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#name", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#hreflang", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang) { + + let element = ( +{ "@value": v.baseName } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#hreflang", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#height", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#height", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#width", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#width", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#preview", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Link ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#preview", descriptor); + + descriptor = { + canonicalIri: "http://purl.org/dc/terms/license", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Link).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Link).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + }, + }; + descriptors.set("http://purl.org/dc/terms/license", descriptor); +descriptors.set("https://schema.org/license", descriptor); +descriptors.set("http://creativecommons.org/ns#license", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The target resource pointed to by a {@link Link}. */ @@ -107720,6 +118271,7 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#preview_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -107732,6 +118284,10 @@ get names(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -108015,6 +118571,7 @@ get licenses(): (URL)[] { const values: Record = {}; array = []; for (const v of this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { + let element = ( { "@id": formatIri(v) } ); @@ -108035,6 +118592,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel) { + let element = ( { "@value": v } ); @@ -108055,6 +118613,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + let element = ( { "@value": v } ); @@ -108075,6 +118634,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase) { + let element = ( { "@value": v } ); @@ -108095,6 +118655,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -108118,6 +118679,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang) { + let element = ( { "@value": v.baseName } ); @@ -108138,6 +118700,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -108161,6 +118724,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -108184,8 +118748,17 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Link ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -108204,6 +118777,7 @@ get licenses(): (URL)[] { array = []; for (const v of this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d) { + let element = ( { "@id": formatIri(v) } ); @@ -108289,6 +118863,8 @@ get licenses(): (URL)[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://purl.org/dc/terms/license","https://schema.org/license","https://www.w3.org/ns/activitystreams#height","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#hreflang","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#rel","https://www.w3.org/ns/activitystreams#width","https://www.w3.org/ns/credentials/v2#digestMultibase"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -108697,12 +119273,22 @@ get licenses(): (URL)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -108756,6 +119342,16 @@ get licenses(): (URL)[] { } instance.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = _2rzkBRS4gNPrkJk9DohHAMUAxA2d; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Link.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -109097,6 +119693,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -109148,9 +119748,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -109313,6 +119914,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://purl.org/dc/terms/license","https://schema.org/license","https://www.w3.org/ns/activitystreams#height","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#hreflang","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#rel","https://www.w3.org/ns/activitystreams#width","https://www.w3.org/ns/credentials/v2#digestMultibase"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -109445,6 +120048,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Hashtag)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -109452,6 +120058,16 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Hashtag.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -109573,6 +120189,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -109638,9 +120258,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -109828,6 +120449,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#height","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/activitystreams#width","https://www.w3.org/ns/credentials/v2#digestMultibase"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -109960,6 +120583,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Image)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -109967,6 +120593,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Image.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -110097,6 +120733,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -110168,9 +120808,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -110345,6 +120986,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -110481,6 +121124,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Offer)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -110488,6 +121134,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Offer.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -110617,6 +121273,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -110688,9 +121348,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -110865,6 +121526,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -110997,6 +121660,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Invite)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -111004,6 +121670,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Invite.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -111133,6 +121809,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -111204,9 +121884,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -111381,6 +122062,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -111513,6 +122196,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Join)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -111520,6 +122206,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Join.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -111649,6 +122345,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -111720,9 +122420,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -111897,6 +122598,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -112029,6 +122732,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Leave)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -112036,6 +122742,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Leave.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -112165,6 +122881,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -112236,9 +122956,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -112413,6 +123134,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -112545,6 +123268,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Like)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -112552,6 +123278,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Like.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -112679,6 +123415,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -112750,9 +123490,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -112927,6 +123668,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -113059,6 +123802,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Listen)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -113066,6 +123812,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Listen.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -113173,6 +123929,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -113224,9 +123984,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -113389,6 +124150,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://purl.org/dc/terms/license","https://schema.org/license","https://www.w3.org/ns/activitystreams#height","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#hreflang","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#rel","https://www.w3.org/ns/activitystreams#width","https://www.w3.org/ns/credentials/v2#digestMultibase"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -113521,6 +124284,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Mention)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -113528,6 +124294,16 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Mention.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -113658,6 +124434,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -113729,9 +124509,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -113906,6 +124687,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -114038,6 +124821,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Move)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -114045,6 +124831,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Move.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -114214,6 +125010,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -114327,9 +125127,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -114457,6 +125258,112 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://w3id.org/fep/044f#quote", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Note).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Note).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set("https://w3id.org/fep/044f#quote", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#quoteUrl", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Note).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ "@value": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Note).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#quoteUrl", descriptor); +descriptors.set("https://misskey-hub.net/ns#_misskey_quote", descriptor); +descriptors.set("http://fedibird.com/ns#quoteUri", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/044f#quoteAuthorization", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Note).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Note).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set("https://w3id.org/fep/044f#quoteAuthorization", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchQuote( url: URL, @@ -114826,6 +125733,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -114838,6 +125746,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -115270,6 +126182,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -115282,6 +126195,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -115457,8 +126374,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -115477,6 +126399,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { "@value": formatIri(v) } ); @@ -115501,8 +126424,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -115587,6 +126515,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://schema.org/license","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -115719,6 +126649,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Note)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -115750,7 +126683,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -115830,7 +126768,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -115847,6 +126790,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Note.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -116089,6 +127042,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -116213,9 +127170,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -116299,6 +127257,83 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#items", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as OrderedCollectionPage).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Object ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { "@list": array }; + }, + values(object: object): readonly unknown[] { + return (object as OrderedCollectionPage).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#items", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#startIndex", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as OrderedCollectionPage).#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as OrderedCollectionPage).#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#startIndex", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchItem( url: URL, @@ -116686,6 +127721,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#item_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -116698,6 +127734,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -116860,8 +127900,17 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -116880,6 +127929,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -116969,6 +128019,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startIndex","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#totalItems","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -117101,6 +128153,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof OrderedCollectionPage)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -117134,12 +128189,22 @@ const base = getDeepCloneDescriptor(this.prototype)!; && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/fep/7aa9#FeatureAuthorization","https://w3id.org/fep/7aa9#FeaturedItem","https://w3id.org/valueflows/ont/vf#Agreement","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://w3id.org/fep/7aa9#FeatureRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -117185,6 +128250,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex = _2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + OrderedCollectionPage.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -118090,6 +129165,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -118915,9 +129994,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -119359,6 +130439,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#preferredUsername", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#publicKey", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set("https://w3id.org/security#publicKey", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#assertionMethod", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set("https://w3id.org/security#assertionMethod", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/ef61/gateways", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ "@id": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { "@list": array }; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); + + descriptor = { + canonicalIri: "http://www.w3.org/ns/ldp#inbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#outbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#following", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#followers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#liked", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featured", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featured", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featuredTags", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/7aa9#featuredCollections", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#streams", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#endpoints", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#discoverable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#suspended", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#memorial", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#indexable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#alsoKnownAs", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/did#service", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set("https://www.w3.org/ns/did#service", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#_misskey_followedMessage", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#isCat", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/6757#preferredLicense", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -119748,6 +131687,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -119760,6 +131700,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -119909,6 +131853,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -119921,6 +131866,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -120333,6 +132282,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -120345,6 +132295,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -120498,6 +132452,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -120510,6 +132465,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -120992,6 +132951,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -121004,6 +132964,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -121436,6 +133400,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -121448,6 +133413,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -121860,6 +133829,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -121872,6 +133842,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -122287,6 +134261,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -122299,6 +134274,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -122712,6 +134691,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -122724,6 +134704,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -123135,6 +135119,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -123147,6 +135132,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -123558,6 +135547,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -123570,6 +135560,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -123978,6 +135972,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -123990,6 +135985,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -124402,6 +136401,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -124414,6 +136414,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -124968,6 +136972,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -124980,6 +136985,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -125451,6 +137460,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -125463,6 +137473,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -125616,6 +137630,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -125628,6 +137643,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -126040,6 +138059,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -126052,6 +138072,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -126205,6 +138229,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -126217,6 +138242,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -126893,6 +138922,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -126916,8 +138946,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -126936,8 +138971,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -126956,6 +138996,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { "@id": v.origin } ); @@ -126976,6 +139017,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { "@value": v } ); @@ -126996,8 +139038,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127016,8 +139067,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127036,8 +139096,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127056,8 +139121,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127076,8 +139146,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127096,8 +139171,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127116,8 +139196,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127136,8 +139221,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127156,8 +139246,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127176,8 +139271,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127196,6 +139296,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { "@value": v } ); @@ -127216,6 +139317,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { "@value": v } ); @@ -127236,6 +139338,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { "@value": v } ); @@ -127256,6 +139359,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { "@value": v } ); @@ -127296,8 +139400,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127316,8 +139441,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127336,8 +139482,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -127356,6 +139507,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { "@value": v } ); @@ -127376,6 +139528,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { "@value": v } ); @@ -127396,6 +139549,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { "@id": formatIri(v) } ); @@ -127497,6 +139651,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -127629,6 +139785,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Organization)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -127693,7 +139852,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -127734,7 +139898,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -127835,11 +140004,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -127882,11 +140061,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -127927,7 +140116,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -127968,7 +140162,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128009,7 +140208,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128050,7 +140254,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128091,7 +140300,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128132,7 +140346,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128173,7 +140392,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128205,7 +140429,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128393,23 +140622,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -128451,23 +140705,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -128508,7 +140787,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -128613,6 +140897,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Organization.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -129294,6 +141588,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -129359,9 +141657,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -129549,6 +141848,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#height","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/activitystreams#width","https://www.w3.org/ns/credentials/v2#digestMultibase"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -129681,6 +141982,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Page)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -129688,6 +141992,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Page.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -130551,6 +142865,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -131376,9 +143694,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -131820,6 +144139,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#preferredUsername", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#publicKey", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set("https://w3id.org/security#publicKey", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#assertionMethod", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set("https://w3id.org/security#assertionMethod", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/ef61/gateways", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ "@id": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { "@list": array }; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); + + descriptor = { + canonicalIri: "http://www.w3.org/ns/ldp#inbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#outbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#following", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#followers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#liked", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featured", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featured", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featuredTags", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/7aa9#featuredCollections", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#streams", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#endpoints", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#discoverable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#suspended", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#memorial", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#indexable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#alsoKnownAs", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/did#service", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set("https://www.w3.org/ns/did#service", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#_misskey_followedMessage", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#isCat", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/6757#preferredLicense", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -132209,6 +145387,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -132221,6 +145400,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -132370,6 +145553,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -132382,6 +145566,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -132794,6 +145982,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -132806,6 +145995,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -132959,6 +146152,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -132971,6 +146165,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -133453,6 +146651,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -133465,6 +146664,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -133897,6 +147100,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -133909,6 +147113,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -134321,6 +147529,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -134333,6 +147542,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -134748,6 +147961,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -134760,6 +147974,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -135173,6 +148391,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -135185,6 +148404,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -135596,6 +148819,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -135608,6 +148832,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -136019,6 +149247,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -136031,6 +149260,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -136439,6 +149672,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -136451,6 +149685,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -136863,6 +150101,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -136875,6 +150114,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -137429,6 +150672,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -137441,6 +150685,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -137912,6 +151160,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -137924,6 +151173,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -138077,6 +151330,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -138089,6 +151343,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -138501,6 +151759,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -138513,6 +151772,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -138666,6 +151929,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -138678,6 +151942,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -139354,6 +152622,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -139377,8 +152646,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139397,8 +152671,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139417,6 +152696,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { "@id": v.origin } ); @@ -139437,6 +152717,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { "@value": v } ); @@ -139457,8 +152738,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139477,8 +152767,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139497,8 +152796,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139517,8 +152821,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139537,8 +152846,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139557,8 +152871,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139577,8 +152896,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139597,8 +152921,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139617,8 +152946,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139637,8 +152971,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139657,6 +152996,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { "@value": v } ); @@ -139677,6 +153017,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { "@value": v } ); @@ -139697,6 +153038,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { "@value": v } ); @@ -139717,6 +153059,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { "@value": v } ); @@ -139757,8 +153100,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139777,8 +153141,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139797,8 +153182,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -139817,6 +153207,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { "@value": v } ); @@ -139837,6 +153228,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { "@value": v } ); @@ -139857,6 +153249,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { "@id": formatIri(v) } ); @@ -139958,6 +153351,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -140090,6 +153485,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Person)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -140154,7 +153552,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140195,7 +153598,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140296,11 +153704,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140343,11 +153761,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140388,7 +153816,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140429,7 +153862,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140470,7 +153908,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140511,7 +153954,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140552,7 +154000,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140593,7 +154046,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140634,7 +154092,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140666,7 +154129,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -140854,23 +154322,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140912,23 +154405,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -140969,7 +154487,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -141074,6 +154597,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Person.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -141842,6 +155375,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -141991,9 +155528,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -142077,6 +155615,207 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#accuracy", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#float", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#accuracy", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#altitude", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#float", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#altitude", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#latitude", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#float", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#latitude", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#longitude", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#float", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#longitude", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#radius", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#float", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#radius", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#units", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Place).#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { + + let element = ( +v == "cm" || v == "feet" || v == "inches" || v == "km" || v == "m" || v == "miles" ?{ "@value": v } :{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Place).#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#units", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** Indicates the accuracy of position coordinates on a {@link Place} objects. * Expressed in properties of percentage. e.g. "94.0" means "94.0% accurate". @@ -142331,6 +156070,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#float", @@ -142354,6 +156094,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#float", @@ -142377,6 +156118,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#float", @@ -142400,6 +156142,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#float", @@ -142423,6 +156166,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#float", @@ -142446,6 +156190,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { + let element = ( v == "cm" || v == "feet" || v == "inches" || v == "km" || v == "m" || v == "miles" ? { "@value": v } : { "@id": formatIri(v) } ); @@ -142532,6 +156277,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#accuracy","https://www.w3.org/ns/activitystreams#altitude","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#latitude","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#longitude","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#radius","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -142664,6 +156411,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Place)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -142848,6 +156598,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units = _oKrwxU4V8wiKhMW1QEYQibcJh8c_units; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Place.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -143110,6 +156870,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -143192,9 +156956,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -143278,6 +157043,46 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#describes", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Profile).#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Profile).#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#describes", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchDescribes( url: URL, @@ -143646,6 +157451,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#describes_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -143658,6 +157464,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -143787,8 +157597,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -143873,6 +157688,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -144005,6 +157822,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Profile)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -144036,7 +157856,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -144053,6 +157878,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Profile.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -144370,6 +158205,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -144607,9 +158446,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -144787,6 +158627,246 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#oneOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#oneOf", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#anyOf", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#anyOf", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#closed", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed) { + + let element = ( +isTemporalInstant(v) ?{ + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": v.toString(), + } :{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#closed", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#votersCount", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + "@value": v, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount; + }, + }; + descriptors.set("http://joinmastodon.org/ns#votersCount", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/044f#quote", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + }, + }; + descriptors.set("https://w3id.org/fep/044f#quote", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#quoteUrl", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + + let element = ( +{ "@value": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#quoteUrl", descriptor); +descriptors.set("https://misskey-hub.net/ns#_misskey_quote", descriptor); +descriptors.set("http://fedibird.com/ns#quoteUri", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/044f#quoteAuthorization", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Question).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Question).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + }, + }; + descriptors.set("https://w3id.org/fep/044f#quoteAuthorization", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchExclusiveOption( url: URL, @@ -145160,6 +159240,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#exclusiveOption_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -145172,6 +159253,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -145587,6 +159672,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#inclusiveOption_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -145599,6 +159685,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -146040,6 +160130,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#quote_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -146052,6 +160143,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -146484,6 +160579,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#quoteAuthorization_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -146496,6 +160592,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -146586,8 +160686,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146606,8 +160711,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146626,6 +160736,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed) { + let element = ( isTemporalInstant(v) ? { "@type": "http://www.w3.org/2001/XMLSchema#dateTime", @@ -146649,6 +160760,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount) { + let element = ( { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -146672,8 +160784,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146692,6 +160809,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { + let element = ( { "@value": formatIri(v) } ); @@ -146716,8 +160834,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -146802,6 +160925,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://joinmastodon.org/ns#votersCount","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://schema.org/license","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#closed","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -146934,6 +161059,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Question)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -146965,7 +161093,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147006,7 +161139,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147115,7 +161253,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147195,7 +161338,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -147212,6 +161360,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Question.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -147484,6 +161642,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -147555,9 +161717,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -147732,6 +161895,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -147864,6 +162029,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Read)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -147871,6 +162039,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Read.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -148000,6 +162178,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -148071,9 +162253,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -148248,6 +162431,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -148384,6 +162569,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Reject)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -148391,6 +162579,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Reject.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -148667,6 +162865,10 @@ relationships?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -148885,9 +163087,10 @@ relationships?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -149017,6 +163220,114 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#subject", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Relationship).#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Relationship).#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#subject", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#object", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Relationship).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Relationship).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#object", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#relationship", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Relationship).#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Relationship).#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#relationship", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} async #fetchSubject( url: URL, @@ -149387,6 +163698,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#subject_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -149399,6 +163711,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -149807,6 +164123,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#object_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -149819,6 +164136,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -149969,6 +164290,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#object_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -149981,6 +164303,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -150392,6 +164718,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#relationship_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -150404,6 +164731,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -150556,6 +164887,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#relationship_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -150568,6 +164900,10 @@ const base = getDeepCloneDescriptor(this.prototype)!; ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -150738,8 +165074,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -150758,8 +165099,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -150778,8 +165124,13 @@ const base = getDeepCloneDescriptor(this.prototype)!; array = []; for (const v of this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -150864,6 +165215,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -150996,6 +165349,9 @@ const base = getDeepCloneDescriptor(this.prototype)!; ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Relationship)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -151027,7 +165383,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -151068,7 +165429,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -151109,7 +165475,12 @@ const base = getDeepCloneDescriptor(this.prototype)!; const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -151126,6 +165497,16 @@ const base = getDeepCloneDescriptor(this.prototype)!; } instance.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Relationship.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -151327,6 +165708,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -151398,9 +165783,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -151575,6 +165961,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -151707,6 +166095,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Remove)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -151714,6 +166105,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Remove.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -152577,6 +166978,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -153402,9 +167807,10 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -153846,6 +168252,865 @@ const base = getDeepCloneDescriptor(this.prototype)!; } } } }); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#preferredUsername", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#publicKey", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + }, + }; + descriptors.set("https://w3id.org/security#publicKey", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/security#assertionMethod", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + }, + }; + descriptors.set("https://w3id.org/security#assertionMethod", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/ef61/gateways", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + + let element = ( +{ "@id": v.origin } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return { "@list": array }; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_hQiaHhZP8hqxckxTBrpsGNs57E3; + }, + }; + descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); + + descriptor = { + canonicalIri: "http://www.w3.org/ns/ldp#inbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + }, + }; + descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#outbox", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof OrderedCollection ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#following", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#followers", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#liked", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featured", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featured", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#featuredTags", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + }, + }; + descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/7aa9#featuredCollections", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + }, + }; + descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#streams", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#endpoints", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + + let element = ( +await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#discoverable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#suspended", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; + }, + }; + descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#memorial", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; + }, + }; + descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); + + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#indexable", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; + }, + }; + descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#alsoKnownAs", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :v instanceof Application ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Group ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Organization ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :v instanceof Person ?await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/did#service", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + + let element = ( +v instanceof URL ? { "@id": formatIri(v) } :await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + }, + }; + descriptors.set("https://www.w3.org/ns/did#service", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#_misskey_followedMessage", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; + }, + }; + descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); + + descriptor = { + canonicalIri: "https://misskey-hub.net/ns#isCat", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; + }, + }; + descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); + + descriptor = { + canonicalIri: "https://w3id.org/fep/6757#preferredLicense", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + + let element = ( +{ "@id": formatIri(v) } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + }, + }; + descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. @@ -154235,6 +169500,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -154247,6 +169513,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -154396,6 +169666,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#publicKey_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -154408,6 +169679,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -154820,6 +170095,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -154832,6 +170108,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -154985,6 +170265,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#assertionMethod_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -154997,6 +170278,10 @@ get preferredUsernames(): ((string | LanguageString))[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -155479,6 +170764,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#inbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -155491,6 +170777,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -155923,6 +171213,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#outbox_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -155935,6 +171226,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -156347,6 +171642,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#following_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -156359,6 +171655,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -156774,6 +172074,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#followers_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -156786,6 +172087,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -157199,6 +172504,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#liked_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -157211,6 +172517,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -157622,6 +172932,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featured_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -157634,6 +172945,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -158045,6 +173360,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredTags_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -158057,6 +173373,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -158465,6 +173785,7 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#featuredCollections_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -158477,6 +173798,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -158889,6 +174214,7 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#stream_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -158901,6 +174227,10 @@ get gateways(): (URL)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -159455,6 +174785,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#successor_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -159467,6 +174798,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -159938,6 +175273,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#alias_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -159950,6 +175286,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -160103,6 +175443,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#alias_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -160115,6 +175456,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -160527,6 +175872,7 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#service_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. @@ -160539,6 +175885,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -160692,6 +176042,7 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#service_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. @@ -160704,6 +176055,10 @@ get attributionDomains(): (string)[] { ? this.id : undefined), }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -161380,6 +176735,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -161403,8 +176759,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161423,8 +176784,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161443,6 +176809,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) { + let element = ( { "@id": v.origin } ); @@ -161463,6 +176830,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers) { + let element = ( { "@value": v } ); @@ -161483,8 +176851,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161503,8 +176880,17 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161523,8 +176909,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161543,8 +176934,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161563,8 +176959,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161583,8 +176984,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161603,8 +177009,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161623,8 +177034,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161643,8 +177059,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161663,8 +177084,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints) { + let element = ( - await v.toJsonLd(options) + await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161683,6 +177109,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable) { + let element = ( { "@value": v } ); @@ -161703,6 +177130,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended) { + let element = ( { "@value": v } ); @@ -161723,6 +177151,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial) { + let element = ( { "@value": v } ); @@ -161743,6 +177172,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable) { + let element = ( { "@value": v } ); @@ -161783,8 +177213,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161803,8 +177254,29 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Group ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Organization ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : v instanceof Person ? await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + ) : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161823,8 +177295,13 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { + let element = ( - retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options)) + retainedSignedValueRef(v, signedValues.scope) ?? (v instanceof URL ? { "@id": formatIri(v) } : await encodeNestedVocabularyValue( + options, + v, + () => v.toJsonLd(options), + )) ); if (Array.isArray(element)) { if (element.length < 1) continue; @@ -161843,6 +177320,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage) { + let element = ( { "@value": v } ); @@ -161863,6 +177341,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat) { + let element = ( { "@value": v } ); @@ -161883,6 +177362,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense) { + let element = ( { "@id": formatIri(v) } ); @@ -161984,6 +177464,8 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -162116,6 +177598,9 @@ get attributionDomains(): (string)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Service)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -162180,7 +177665,12 @@ get attributionDomains(): (string)[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162221,7 +177711,12 @@ get attributionDomains(): (string)[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162322,11 +177817,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162369,11 +177874,21 @@ get attributionDomains(): (string)[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#OrderedCollection","https://w3id.org/fep/7aa9#FeaturedCollection"].some( t => v["@type"].includes(t)) ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162414,7 +177929,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162455,7 +177975,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162496,7 +178021,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162537,7 +178067,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162578,7 +178113,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162619,7 +178159,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162660,7 +178205,12 @@ get attributionDomains(): (string)[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162692,7 +178242,12 @@ get attributionDomains(): (string)[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -162880,23 +178435,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162938,23 +178518,48 @@ get attributionDomains(): (string)[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) : undefined ; @@ -162995,7 +178600,12 @@ get attributionDomains(): (string)[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: options.baseUrl } + { + ...options, + baseUrl: options.baseUrl, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } ) ; @@ -163100,6 +178710,16 @@ get attributionDomains(): (string)[] { } instance.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = _248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Service.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -163720,7 +179340,7 @@ get attributionDomains(): (string)[] { }; /** Contents of {@link Object}'s \`source\`. */ -export class Source { +export class Source implements VocabularyObject { readonly #documentLoader?: DocumentLoader; readonly #contextLoader?: DocumentLoader; @@ -163736,6 +179356,14 @@ export class Source { #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -163929,6 +179557,10 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -163969,6 +179601,7 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.length < vocabSparseArrayMinimumLength ? this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice() : vocabCopyPropertyArray(this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content); if ("content" in values && values.content != null) { @@ -164061,9 +179694,10 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -164120,6 +179754,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); } }); } +static { + + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: Source, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#content", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Source).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + + let element = ( +typeof v === "string" ?{ "@value": v } :{ + "@value": v.toString(), + "@language": v.locale.baseName, + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Source).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#content", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#mediaType", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Source).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Source).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#mediaType", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** The source content. */ @@ -164239,6 +179958,7 @@ get contents(): ((string | LanguageString))[] { const values: Record = {}; array = []; for (const v of this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content) { + let element = ( typeof v === "string" ? { "@value": v } : { "@value": v.toString(), @@ -164262,6 +179982,7 @@ get contents(): ((string | LanguageString))[] { array = []; for (const v of this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType) { + let element = ( { "@value": v } ); @@ -164342,6 +180063,8 @@ get contents(): ((string | LanguageString))[] { return true; } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#mediaType"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -164540,6 +180263,16 @@ get contents(): ((string | LanguageString))[] { } instance.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = _3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Source.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -164730,6 +180463,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -164801,9 +180538,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -164978,6 +180716,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -165110,6 +180850,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof TentativeAccept)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -165117,6 +180860,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + TentativeAccept.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -165246,6 +180999,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -165317,9 +181074,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -165494,6 +181252,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -165626,6 +181386,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof TentativeReject)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -165633,6 +181396,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + TentativeReject.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -165833,6 +181606,10 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -165974,9 +181751,10 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -166031,6 +181809,75 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} }; return deepCloneGraph(this, this.clone(values, cloneOptions)); } +static { + + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#formerType", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Tombstone).#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { + + let element = ( +{ "@id": v.typeId.href } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Tombstone).#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#formerType", descriptor); + + descriptor = { + canonicalIri: "https://www.w3.org/ns/activitystreams#deleted", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Tombstone).#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { + + let element = ( +{ + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Tombstone).#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; + }, + }; + descriptors.set("https://www.w3.org/ns/activitystreams#deleted", descriptor); +rawPropertyDescriptors.set(this.prototype, descriptors); +} /** On a \`Tombstone\` object, the \`formerType\` property identifies the type of * the object that was deleted. @@ -166103,57 +181950,766 @@ get formerTypes(): ($EntityType)[] { // child documents back in place of their placeholders. const signedValues = enterSignedValueScope(options); - if (options.format == null && this.isCompactable()) { - - const result = await super.toJsonLd({ - ...options, - format: undefined, - context: undefined, - }) as Record; - - // deno-lint-ignore no-unused-vars - let compactItems: unknown[]; - - compactItems = []; - for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { - const item = ( - { "@id": v.typeId.href } - ); - compactItems.push(item); - } - if (compactItems.length > 0) { - - result["formerType"] - = compactItems.length > 1 - ? compactItems - : compactItems[0]; - - } - - compactItems = []; - for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { - const item = ( - v.toString() - ); - compactItems.push(item); - } - if (compactItems.length > 0) { - - result["deleted"] - = compactItems.length > 1 - ? compactItems - : compactItems[0]; - - } - - result["type"] = "Tombstone"; - if (this.id != null) result["id"] = formatIri(this.id); - result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; - return signedValues.owner - ? resolveSignedValues(result, signedValues.scope) - : result; - } - + if (options.format == null && this.isCompactable()) { + + const result = await super.toJsonLd({ + ...options, + format: undefined, + context: undefined, + }) as Record; + + // deno-lint-ignore no-unused-vars + let compactItems: unknown[]; + + compactItems = []; + for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { + const item = ( + { "@id": v.typeId.href } + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result["formerType"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + + compactItems = []; + for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { + const item = ( + v.toString() + ); + compactItems.push(item); + } + if (compactItems.length > 0) { + + result["deleted"] + = compactItems.length > 1 + ? compactItems + : compactItems[0]; + + } + + result["type"] = "Tombstone"; + if (this.id != null) result["id"] = formatIri(this.id); + result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + return signedValues.owner + ? resolveSignedValues(result, signedValues.scope) + : result; + } + + // deno-lint-ignore no-unused-vars prefer-const + let array: unknown[]; + + const baseValues = await super.toJsonLd({ + ...options, + format: "expand", + context: undefined, + }) as unknown[]; + const values = baseValues[0] as Record< + string, + unknown[] | { "@list": unknown[] } | string + >; + + array = []; + for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { + + let element = ( + { "@id": v.typeId.href } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values["https://www.w3.org/ns/activitystreams#formerType"] = propValue; + + } + + array = []; + for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { + + let element = ( + { + "@type": "http://www.w3.org/2001/XMLSchema#dateTime", + "@value": v.toString(), + } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; + array.push(element);; + } + if (array.length > 0) { + const propValue = ( + array + ); + values["https://www.w3.org/ns/activitystreams#deleted"] = propValue; + + } + + values["@type"] = ["https://www.w3.org/ns/activitystreams#Tombstone"]; + if (this.id != null) values["@id"] = formatIri(this.id); + if (options.format === "expand") { + return await jsonld.expand( + values, + { + documentLoader: options.contextLoader, + keepFreeFloatingNodes: true, + }, + ); + } + let docContext: Parameters[1] = options.context ?? + ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + + if (options.context == null) { + const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; + const additionalContexts = getExtraContexts(values).filter( + context => !currentContexts.includes(context) + ); + if (additionalContexts.length > 0) { + docContext = [...currentContexts, ...additionalContexts]; + } + } + + let compacted = await jsonld.compact( + values, + docContext, + { documentLoader: options.contextLoader }, + ); + + if (options.context == null) { + const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; + const additionalContexts = getExtraContexts(compacted).filter( + context => !currentContexts.includes(context) + ); + if (additionalContexts.length > 0) { + docContext = [...currentContexts, ...additionalContexts]; + compacted = await jsonld.compact(values, docContext, { + documentLoader: options.contextLoader, + }); + } + } + + if (docContext != null) { + // Embed context + + if ("proof" in compacted && + compacted.proof != null) { + if (Array.isArray(compacted.proof)) { + for (const element of compacted.proof) { + element["@context"] = docContext; + } + } else { + compacted.proof["@context"] = docContext; + } + } + + } + return signedValues.owner + ? resolveSignedValues(compacted, signedValues.scope) + : compacted; + } + + protected override isCompactable(): boolean { + + if ( + this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType != null && + this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0 + ) return false; + + return super.isCompactable(); + } + + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#deleted","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#formerType","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + + /** + * Converts a JSON-LD structure to an object of this type. + * @param json The JSON-LD structure to convert. + * @param options The options to use. + * - \`documentLoader\`: The loader for remote JSON-LD documents. + * - \`contextLoader\`: The loader for remote JSON-LD contexts. + * - \`tracerProvider\`: The OpenTelemetry tracer provider to use. + * If omitted, the global tracer provider is used. + * - \`verifyPortableObject\`: The default FEP-ef61 portable + * object verifier for the property accessors of the + * returned object and the objects obtained from it. It + * does not verify the given \`json\` itself. + * @returns The object of this type. + * @throws {TypeError} If the given \`json\` is invalid. + */ + static override async fromJsonLd( + json: unknown, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + baseUrl?: URL, + } = {}, + ): Promise { + const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); + const tracer = tracerProvider.getTracer( + "@fedify/vocab-tools", + "0.0.0", + ); + return await tracer.startActiveSpan( + "activitypub.parse_object", + async (span) => { + try { + const object = await this.__fromJsonLd__Tombstone__( + json, span, options); + if (object.id != null) { + span.setAttribute("activitypub.object.id", object.id.href); + } + return object; + } catch (error) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: String(error), + }); + throw error; + } finally { + span.end(); + } + }, + ); + } + + protected static async __fromJsonLd__Tombstone__( + json: unknown, + span: Span, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + baseUrl?: URL, + } = {}, + ): Promise { + if (typeof json === "undefined") { + throw new TypeError("Invalid JSON-LD: undefined."); + } + else if (json === null) throw new TypeError("Invalid JSON-LD: null."); + options = { + ...options, + documentLoader: options.documentLoader ?? getDocumentLoader(), + contextLoader: options.contextLoader ?? getDocumentLoader(), + tracerProvider: options.tracerProvider ?? trace.getTracerProvider(), + }; + // deno-lint-ignore no-explicit-any + let values: Record & { "@id"?: string }; + let expanded: unknown[]; + if ( + "_fromSubclass" in options && + options._fromSubclass && + typeof json === "object" && + !Array.isArray(json) + ) { + values = + // deno-lint-ignore no-explicit-any + json as (Record & { "@id"?: string }); + expanded = [values]; + } else if (globalThis.Object.keys(json).length == 0) { + values = {}; + expanded = [values]; + } else { + expanded = await jsonld.expand(json, { + documentLoader: options.contextLoader, + keepFreeFloatingNodes: true, + }); + values = + // deno-lint-ignore no-explicit-any + (expanded[0] ?? {}) as (Record & { "@id"?: string }); + } + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; + } + + if ("@type" in values) { + span.setAttribute("activitypub.object.type", values["@type"]); + } + if ("@type" in values && + !values["@type"].every(t => t.startsWith("_:"))) { + + if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Tombstone")) { + throw new TypeError("Invalid type: " + values["@type"]); + } + } + + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) + : undefined; + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); + } + + const superValues = structuredClone(values); + delete superValues["@type"]; + const instance = await super.fromJsonLd(superValues, { + ...options, + // @ts-ignore: an internal option + _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, + }); + if (!(instance instanceof Tombstone)) { + throw new TypeError("Unexpected type: " + instance.constructor.name); + } + + let shouldCacheJsonLd = instance._shouldCacheJsonLd; + const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType: ($EntityType)[] = []; + + let _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array = values["https://www.w3.org/ns/activitystreams#formerType"]; + + for ( + const v of _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array == null + ? [] + : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array.length === 1 && "@list" in _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0] + ? _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0]["@list"] + : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array + ) { + if (v == null) continue; + + const decoded = + (() => { + if (v == null || typeof v !== "object" || !("@id" in v) || + typeof v["@id"] !== "string" || v["@id"] === "") { + return undefined; + } + const entityType = getEntityTypeById(v["@id"]); + if (entityType == null) { + getLogger(["fedify", "vocab"]).warn( + "Ignoring unknown vocabulary entity type reference: {typeId}", + { typeId: v["@id"] }, + ); + } + return entityType; + })() + ; + + if (typeof decoded === "undefined") { + shouldCacheJsonLd = false; + continue; + } + + if (!this._shouldCacheDecodedJsonLd(decoded)) { + shouldCacheJsonLd = false; + } + _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.push(decoded); + + } + instance.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; + const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted: (Temporal.Instant)[] = []; + + let _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array = values["https://www.w3.org/ns/activitystreams#deleted"]; + + for ( + const v of _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array == null + ? [] + : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array.length === 1 && "@list" in _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0] + ? _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0]["@list"] + : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array + ) { + if (v == null) continue; + + const decoded = + Temporal.Instant.from( + v["@value"].substring(19).match(/[Z+-]/) + ? v["@value"] + : v["@value"] + "Z" + ) + ; + + if (typeof decoded === "undefined") { + shouldCacheJsonLd = false; + continue; + } + + if (!this._shouldCacheDecodedJsonLd(decoded)) { + shouldCacheJsonLd = false; + } + _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(decoded); + + } + instance.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; + + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Tombstone.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } + instance._shouldCacheJsonLd = shouldCacheJsonLd; + if ( + shouldCacheJsonLd && + (!("_fromSubclass" in options) || !options._fromSubclass) + ) { + try { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const normalized = cacheJsonLd; + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + } else { + instance._cachedJsonLd = structuredClone(json); + } + } catch { + getLogger(["fedify", "vocab"]).warn( + "Failed to cache JSON-LD: {json}", + { json }, + ); + } + } + return instance; + } + + protected override _getCustomInspectProxy(): Record { + const proxy: Record = super._getCustomInspectProxy(); + const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for("Deno.customInspect")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => "URL " + inspect(inspectIri(v), options), + [Symbol.for("nodejs.util.inspect.custom")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => "URL " + inspect(inspectIri(v), options), + } + : v); + + if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length == 1) { + proxy.formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType[0]; + } + + if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 1 + || !("formerType" in proxy) + && _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0) { + proxy.formerTypes = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; + } + + const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted + // deno-lint-ignore no-explicit-any + .map((v: any) => v instanceof URL + ? { + [Symbol.for("Deno.customInspect")]: ( + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string => "URL " + inspect(inspectIri(v), options), + [Symbol.for("nodejs.util.inspect.custom")]: ( + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string => "URL " + inspect(inspectIri(v), options), + } + : v); + + if (_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.length == 1) { + proxy.deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted[0]; + } + + return proxy; + } + } + + +// deno-lint-ignore no-explicit-any +(Tombstone.prototype as any)[Symbol.for("Deno.customInspect")] = + function ( + this: Tombstone, + inspect: typeof Deno.inspect, + options: Deno.InspectOptions, + ): string { + const proxy = this._getCustomInspectProxy(); + return "Tombstone " + inspect(proxy, options); + }; + +// deno-lint-ignore no-explicit-any +(Tombstone.prototype as any)[Symbol.for("nodejs.util.inspect.custom")] = + function ( + this: Tombstone, + _depth: number, + options: unknown, + inspect: (value: unknown, options: unknown) => string, + ): string { + const proxy = this._getCustomInspectProxy(); + return "Tombstone " + inspect(proxy, options); + }; + /** Indicates that the \`actor\` is traveling to \`target\` from \`origin\`. + * \`Travel\` is an \`IntransitiveObject\` whose \`actor\` specifies the direct object. + * If the \`target\` or \`origin\` are not specified, + * either can be determined by context. + * + */ +export class Travel extends IntransitiveActivity { + + /** + * The type URI of {@link Travel}: \`https://www.w3.org/ns/activitystreams#Travel\`. + */ + static override get typeId(): URL { + return new URL("https://www.w3.org/ns/activitystreams#Travel"); + } + + /** + * Constructs a new instance of Travel with the given values. + * @param values The values to initialize the instance with. + * @param options The options to use for initialization. + */ + constructor( + values: + { +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} +, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + } = {}, + ) { + super(values, options);} + + /** + * Clones this instance, optionally updating it with the given values. + * + * This is a shallow copy: property arrays are copied, but nested objects + * and URLs are shared with this instance. Dereferencing accessors can cache + * fetched objects in the instance whose accessor is called. Hydrating a + * shared nested object through the clone can affect the original as well, + * and can change JSON-LD output when either is embedded in another + * object. Hydrating a top-level property of the clone does not update this + * instance's property. + * + * To resolve properties without sharing nested objects, use + * {@link Travel.deepClone} before hydration. + * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) + * for details, including how cached JSON-LD affects serialization. + * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * + * A clone never inherits a signed JSON-LD representation retained by + * \`signObject()\`: the clone may differ from the document that the proof + * covers, so embedding the original secured JSON in a parent document + * would be wrong. Sign the clone again if it has to be embedded as a + * secured child. + * + * @param values The values to update the clone with. + * @param options The options to use for cloning. + * @returns The cloned instance with its own property arrays. Nested objects + * and URLs are shared with this instance. + */ + override clone( + values: + { +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {} + ): Travel { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: $warning is not recognized as a property, but it is. + options = { ...options, $warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as Travel; + return clone; + } + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Travel { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + + /** + * Converts this object to a JSON-LD structure. + * @param options The options to use. + * - \`format\`: The format of the output: \`compact\` or + \`expand\`. + * - \`contextLoader\`: The loader for remote JSON-LD contexts. + * - \`context\`: The JSON-LD context to use. Not applicable + when \`format\` is set to \`'expand'\`. + * @returns The JSON-LD representation of this object. + */ + override async toJsonLd(options: { + format?: "compact" | "expand", + contextLoader?: DocumentLoader, + context?: string | Record | (string | Record)[], + } = {}): Promise { + if (options.format == null && this._cachedJsonLd != null) { + return this._cachedJsonLd; + } + if (options.format !== "compact" && options.context != null) { + throw new TypeError( + "The context option can only be used when the format option is set " + + "to 'compact'." + ); + } + options = { + ...options, + contextLoader: options.contextLoader ?? getDocumentLoader(), + }; + // Joins the enclosing frame's signed-value scope, or starts one when this + // frame is the outermost. Only the owning frame puts retained signed + // child documents back in place of their placeholders. + const signedValues = enterSignedValueScope(options); + // deno-lint-ignore no-unused-vars prefer-const let array: unknown[]; @@ -166167,50 +182723,7 @@ get formerTypes(): ($EntityType)[] { unknown[] | { "@list": unknown[] } | string >; - array = []; - for (const v of this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType) { - let element = ( - { "@id": v.typeId.href } - ); - if (Array.isArray(element)) { - if (element.length < 1) continue; - if (element.length == 1) element = element[0]; - } - if (typeof element === "undefined") continue; - array.push(element);; - } - if (array.length > 0) { - const propValue = ( - array - ); - values["https://www.w3.org/ns/activitystreams#formerType"] = propValue; - - } - - array = []; - for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted) { - let element = ( - { - "@type": "http://www.w3.org/2001/XMLSchema#dateTime", - "@value": v.toString(), - } - ); - if (Array.isArray(element)) { - if (element.length < 1) continue; - if (element.length == 1) element = element[0]; - } - if (typeof element === "undefined") continue; - array.push(element);; - } - if (array.length > 0) { - const propValue = ( - array - ); - values["https://www.w3.org/ns/activitystreams#deleted"] = propValue; - - } - - values["@type"] = ["https://www.w3.org/ns/activitystreams#Tombstone"]; + values["@type"] = ["https://www.w3.org/ns/activitystreams#Travel"]; if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( @@ -166222,7 +182735,7 @@ get formerTypes(): ($EntityType)[] { ); } let docContext: Parameters[1] = options.context ?? - ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + ["https://w3id.org/identity/v1","https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; if (options.context == null) { const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; @@ -166275,14 +182788,11 @@ get formerTypes(): ($EntityType)[] { protected override isCompactable(): boolean { - if ( - this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType != null && - this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0 - ) return false; - return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -166307,7 +182817,7 @@ get formerTypes(): ($EntityType)[] { verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); const tracer = tracerProvider.getTracer( "@fedify/vocab-tools", @@ -166317,7 +182827,7 @@ get formerTypes(): ($EntityType)[] { "activitypub.parse_object", async (span) => { try { - const object = await this.__fromJsonLd__Tombstone__( + const object = await this.__fromJsonLd__Travel__( json, span, options); if (object.id != null) { span.setAttribute("activitypub.object.id", object.id.href); @@ -166336,7 +182846,7 @@ get formerTypes(): ($EntityType)[] { ); } - protected static async __fromJsonLd__Tombstone__( + protected static async __fromJsonLd__Travel__( json: unknown, span: Span, options: { @@ -166346,7 +182856,7 @@ get formerTypes(): ($EntityType)[] { verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { if (typeof json === "undefined") { throw new TypeError("Invalid JSON-LD: undefined."); } @@ -166393,7 +182903,7 @@ get formerTypes(): ($EntityType)[] { if ("@type" in values && !values["@type"].every(t => t.startsWith("_:"))) { - if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Tombstone")) { + if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Travel")) { throw new TypeError("Invalid type: " + values["@type"]); } } @@ -166415,88 +182925,26 @@ get formerTypes(): ($EntityType)[] { ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); - if (!(instance instanceof Tombstone)) { + if (!(instance instanceof Travel)) { throw new TypeError("Unexpected type: " + instance.constructor.name); } let shouldCacheJsonLd = instance._shouldCacheJsonLd; - const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType: ($EntityType)[] = []; - - let _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array = values["https://www.w3.org/ns/activitystreams#formerType"]; - - for ( - const v of _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array == null - ? [] - : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array.length === 1 && "@list" in _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0] - ? _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array[0]["@list"] - : _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType__array - ) { - if (v == null) continue; - - const decoded = - (() => { - if (v == null || typeof v !== "object" || !("@id" in v) || - typeof v["@id"] !== "string" || v["@id"] === "") { - return undefined; - } - const entityType = getEntityTypeById(v["@id"]); - if (entityType == null) { - getLogger(["fedify", "vocab"]).warn( - "Ignoring unknown vocabulary entity type reference: {typeId}", - { typeId: v["@id"] }, - ); - } - return entityType; - })() - ; - - if (typeof decoded === "undefined") { - shouldCacheJsonLd = false; - continue; - } - - if (!this._shouldCacheDecodedJsonLd(decoded)) { - shouldCacheJsonLd = false; - } - _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.push(decoded); - - } - instance.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; - const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted: (Temporal.Instant)[] = []; - - let _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array = values["https://www.w3.org/ns/activitystreams#deleted"]; - - for ( - const v of _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array == null - ? [] - : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array.length === 1 && "@list" in _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0] - ? _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array[0]["@list"] - : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array + + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false ) { - if (v == null) continue; - - const decoded = - Temporal.Instant.from( - v["@value"].substring(19).match(/[Z+-]/) - ? v["@value"] - : v["@value"] + "Z" - ) - ; - - if (typeof decoded === "undefined") { - shouldCacheJsonLd = false; - continue; - } - - if (!this._shouldCacheDecodedJsonLd(decoded)) { - shouldCacheJsonLd = false; - } - _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(decoded); - + const retained = retainRawProperties( + values, + Travel.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); } - instance.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; - instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -166528,96 +182976,53 @@ get formerTypes(): ($EntityType)[] { protected override _getCustomInspectProxy(): Record { const proxy: Record = super._getCustomInspectProxy(); - const _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType - // deno-lint-ignore no-explicit-any - .map((v: any) => v instanceof URL - ? { - [Symbol.for("Deno.customInspect")]: ( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string => "URL " + inspect(inspectIri(v), options), - [Symbol.for("nodejs.util.inspect.custom")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => "URL " + inspect(inspectIri(v), options), - } - : v); - - if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length == 1) { - proxy.formerType = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType[0]; - } - - if (_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 1 - || !("formerType" in proxy) - && _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length > 0) { - proxy.formerTypes = _Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; - } - - const _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted - // deno-lint-ignore no-explicit-any - .map((v: any) => v instanceof URL - ? { - [Symbol.for("Deno.customInspect")]: ( - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string => "URL " + inspect(inspectIri(v), options), - [Symbol.for("nodejs.util.inspect.custom")]: ( - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string => "URL " + inspect(inspectIri(v), options), - } - : v); - - if (_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.length == 1) { - proxy.deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted[0]; - } - return proxy; } } // deno-lint-ignore no-explicit-any -(Tombstone.prototype as any)[Symbol.for("Deno.customInspect")] = +(Travel.prototype as any)[Symbol.for("Deno.customInspect")] = function ( - this: Tombstone, + this: Travel, inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string { const proxy = this._getCustomInspectProxy(); - return "Tombstone " + inspect(proxy, options); + return "Travel " + inspect(proxy, options); }; // deno-lint-ignore no-explicit-any -(Tombstone.prototype as any)[Symbol.for("nodejs.util.inspect.custom")] = +(Travel.prototype as any)[Symbol.for("nodejs.util.inspect.custom")] = function ( - this: Tombstone, + this: Travel, _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string { const proxy = this._getCustomInspectProxy(); - return "Tombstone " + inspect(proxy, options); + return "Travel " + inspect(proxy, options); }; - /** Indicates that the \`actor\` is traveling to \`target\` from \`origin\`. - * \`Travel\` is an \`IntransitiveObject\` whose \`actor\` specifies the direct object. - * If the \`target\` or \`origin\` are not specified, - * either can be determined by context. + /** Indicates that the \`actor\` is undoing the \`object\`. In most cases, + * the \`object\` will be an {@link Activity} describing some previously performed + * action (for instance, a person may have previously "liked" an article but, + * for whatever reason, might choose to undo that like at some later point in + * time). + * + * The \`target\` and \`origin\` typically have no defined meaning. * */ -export class Travel extends IntransitiveActivity { +export class Undo extends Activity { /** - * The type URI of {@link Travel}: \`https://www.w3.org/ns/activitystreams#Travel\`. + * The type URI of {@link Undo}: \`https://www.w3.org/ns/activitystreams#Undo\`. */ static override get typeId(): URL { - return new URL("https://www.w3.org/ns/activitystreams#Travel"); + return new URL("https://www.w3.org/ns/activitystreams#Undo"); } /** - * Constructs a new instance of Travel with the given values. + * Constructs a new instance of Undo with the given values. * @param values The values to initialize the instance with. * @param options The options to use for initialization. */ @@ -166670,10 +183075,14 @@ instruments?: (Object | URL)[];} * instance's property. * * To resolve properties without sharing nested objects, use - * {@link Travel.deepClone} before hydration. + * {@link Undo.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -166719,7 +183128,7 @@ instruments?: (Object | URL)[];} contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, } = {} - ): Travel { + ): Undo { if (this._warning != null) { getLogger(this._warning.category).warn( this._warning.message, @@ -166728,7 +183137,7 @@ instruments?: (Object | URL)[];} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Travel; + const clone = super.clone(values, options) as unknown as Undo; return clone; } @@ -166745,9 +183154,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -166797,7 +183207,7 @@ instruments?: (Object | URL)[];} documentLoader?: DocumentLoader, contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, - } = {}): Travel { + } = {}): Undo { const cloneOptions = { documentLoader: options.documentLoader ?? this._documentLoader, contextLoader: options.contextLoader ?? this._contextLoader, @@ -166854,7 +183264,7 @@ instruments?: (Object | URL)[];} unknown[] | { "@list": unknown[] } | string >; - values["@type"] = ["https://www.w3.org/ns/activitystreams#Travel"]; + values["@type"] = ["https://www.w3.org/ns/activitystreams#Undo"]; if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( @@ -166866,7 +183276,7 @@ instruments?: (Object | URL)[];} ); } let docContext: Parameters[1] = options.context ?? - ["https://w3id.org/identity/v1","https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; + ["https://w3id.org/identity/v1","https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns",{"litepub":"http://litepub.social/ns#","toot":"http://joinmastodon.org/ns#","EmojiReact":"litepub:EmojiReact","Emoji":"toot:Emoji"}]; if (options.context == null) { const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; @@ -166922,6 +183332,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -166946,7 +183358,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); const tracer = tracerProvider.getTracer( "@fedify/vocab-tools", @@ -166956,7 +183368,7 @@ instruments?: (Object | URL)[];} "activitypub.parse_object", async (span) => { try { - const object = await this.__fromJsonLd__Travel__( + const object = await this.__fromJsonLd__Undo__( json, span, options); if (object.id != null) { span.setAttribute("activitypub.object.id", object.id.href); @@ -166975,7 +183387,7 @@ instruments?: (Object | URL)[];} ); } - protected static async __fromJsonLd__Travel__( + protected static async __fromJsonLd__Undo__( json: unknown, span: Span, options: { @@ -166985,7 +183397,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { if (typeof json === "undefined") { throw new TypeError("Invalid JSON-LD: undefined."); } @@ -167032,7 +183444,7 @@ instruments?: (Object | URL)[];} if ("@type" in values && !values["@type"].every(t => t.startsWith("_:"))) { - if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Travel")) { + if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Undo")) { throw new TypeError("Invalid type: " + values["@type"]); } } @@ -167054,13 +183466,26 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); - if (!(instance instanceof Travel)) { + if (!(instance instanceof Undo)) { throw new TypeError("Unexpected type: " + instance.constructor.name); } let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Undo.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -167098,47 +183523,45 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any -(Travel.prototype as any)[Symbol.for("Deno.customInspect")] = +(Undo.prototype as any)[Symbol.for("Deno.customInspect")] = function ( - this: Travel, + this: Undo, inspect: typeof Deno.inspect, options: Deno.InspectOptions, ): string { const proxy = this._getCustomInspectProxy(); - return "Travel " + inspect(proxy, options); + return "Undo " + inspect(proxy, options); }; // deno-lint-ignore no-explicit-any -(Travel.prototype as any)[Symbol.for("nodejs.util.inspect.custom")] = +(Undo.prototype as any)[Symbol.for("nodejs.util.inspect.custom")] = function ( - this: Travel, + this: Undo, _depth: number, options: unknown, inspect: (value: unknown, options: unknown) => string, ): string { const proxy = this._getCustomInspectProxy(); - return "Travel " + inspect(proxy, options); + return "Undo " + inspect(proxy, options); }; - /** Indicates that the \`actor\` is undoing the \`object\`. In most cases, - * the \`object\` will be an {@link Activity} describing some previously performed - * action (for instance, a person may have previously "liked" an article but, - * for whatever reason, might choose to undo that like at some later point in - * time). + /** Indicates that the \`actor\` has updated the \`object\`. Note, however, + * that this vocabulary does not define a mechanism for describing the actual + * set of modifications made to \`object\`. * * The \`target\` and \`origin\` typically have no defined meaning. * */ -export class Undo extends Activity { +export class Update extends Activity { /** - * The type URI of {@link Undo}: \`https://www.w3.org/ns/activitystreams#Undo\`. + * The type URI of {@link Update}: \`https://www.w3.org/ns/activitystreams#Update\`. */ static override get typeId(): URL { - return new URL("https://www.w3.org/ns/activitystreams#Undo"); + return new URL("https://www.w3.org/ns/activitystreams#Update"); } /** - * Constructs a new instance of Undo with the given values. + * Constructs a new instance of Update with the given values. * @param values The values to initialize the instance with. * @param options The options to use for initialization. */ @@ -167191,10 +183614,14 @@ instruments?: (Object | URL)[];} * instance's property. * * To resolve properties without sharing nested objects, use - * {@link Undo.deepClone} before hydration. + * {@link Update.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -167240,7 +183667,7 @@ instruments?: (Object | URL)[];} contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, } = {} - ): Undo { + ): Update { if (this._warning != null) { getLogger(this._warning.category).warn( this._warning.message, @@ -167249,7 +183676,7 @@ instruments?: (Object | URL)[];} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Undo; + const clone = super.clone(values, options) as unknown as Update; return clone; } @@ -167266,9 +183693,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -167318,7 +183746,7 @@ instruments?: (Object | URL)[];} documentLoader?: DocumentLoader, contextLoader?: DocumentLoader, verifyPortableObject?: PortableObjectVerifier, - } = {}): Undo { + } = {}): Update { const cloneOptions = { documentLoader: options.documentLoader ?? this._documentLoader, contextLoader: options.contextLoader ?? this._contextLoader, @@ -167375,7 +183803,7 @@ instruments?: (Object | URL)[];} unknown[] | { "@list": unknown[] } | string >; - values["@type"] = ["https://www.w3.org/ns/activitystreams#Undo"]; + values["@type"] = ["https://www.w3.org/ns/activitystreams#Update"]; if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( @@ -167387,7 +183815,7 @@ instruments?: (Object | URL)[];} ); } let docContext: Parameters[1] = options.context ?? - ["https://w3id.org/identity/v1","https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns",{"litepub":"http://litepub.social/ns#","toot":"http://joinmastodon.org/ns#","EmojiReact":"litepub:EmojiReact","Emoji":"toot:Emoji"}]; + ["https://w3id.org/identity/v1","https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","sensitive":"as:sensitive","movedTo":{"@id":"as:movedTo","@type":"@id"},"quoteUrl":"as:quoteUrl","toot":"http://joinmastodon.org/ns#","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","attributionDomains":{"@id":"toot:attributionDomains","@container":"@set"},"votersCount":{"@id":"toot:votersCount","@type":"http://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"Emoji":"toot:Emoji","Hashtag":"as:Hashtag","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","ChatMessage":"http://litepub.social/ns#ChatMessage","quote":{"@id":"https://w3id.org/fep/044f#quote","@type":"@id"},"fedibird":"http://fedibird.com/ns#","quoteUri":"fedibird:quoteUri","QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization","QuoteRequest":"https://w3id.org/fep/044f#QuoteRequest","quoteAuthorization":{"@id":"https://w3id.org/fep/044f#quoteAuthorization","@type":"@id"},"misskey":"https://misskey-hub.net/ns#","_misskey_quote":"misskey:_misskey_quote","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat","emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; if (options.context == null) { const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; @@ -167443,6 +183871,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -167467,7 +183897,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); const tracer = tracerProvider.getTracer( "@fedify/vocab-tools", @@ -167477,7 +183907,7 @@ instruments?: (Object | URL)[];} "activitypub.parse_object", async (span) => { try { - const object = await this.__fromJsonLd__Undo__( + const object = await this.__fromJsonLd__Update__( json, span, options); if (object.id != null) { span.setAttribute("activitypub.object.id", object.id.href); @@ -167496,7 +183926,7 @@ instruments?: (Object | URL)[];} ); } - protected static async __fromJsonLd__Undo__( + protected static async __fromJsonLd__Update__( json: unknown, span: Span, options: { @@ -167506,7 +183936,7 @@ instruments?: (Object | URL)[];} verifyPortableObject?: PortableObjectVerifier, baseUrl?: URL, } = {}, - ): Promise { + ): Promise { if (typeof json === "undefined") { throw new TypeError("Invalid JSON-LD: undefined."); } @@ -167553,7 +183983,7 @@ instruments?: (Object | URL)[];} if ("@type" in values && !values["@type"].every(t => t.startsWith("_:"))) { - if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Undo")) { + if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Update")) { throw new TypeError("Invalid type: " + values["@type"]); } } @@ -167575,532 +184005,26 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); - if (!(instance instanceof Undo)) { + if (!(instance instanceof Update)) { throw new TypeError("Unexpected type: " + instance.constructor.name); } let shouldCacheJsonLd = instance._shouldCacheJsonLd; - instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( - shouldCacheJsonLd && - (!("_fromSubclass" in options) || !options._fromSubclass) + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false ) { - try { - if (cacheJsonLd != null && cacheJsonLd !== expanded) { - const compactArray = Array.isArray(json) && json.length === 1; - const jsonLd = compactArray ? json[0] : json; - const normalized = cacheJsonLd; - const cachedJsonLd = await compactJsonLdCache( - normalized, - jsonLd, - options.contextLoader, - ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; - } else { - instance._cachedJsonLd = structuredClone(json); - } - } catch { - getLogger(["fedify", "vocab"]).warn( - "Failed to cache JSON-LD: {json}", - { json }, - ); - } - } - return instance; - } - - protected override _getCustomInspectProxy(): Record { - const proxy: Record = super._getCustomInspectProxy(); - return proxy; - } - } - - -// deno-lint-ignore no-explicit-any -(Undo.prototype as any)[Symbol.for("Deno.customInspect")] = - function ( - this: Undo, - inspect: typeof Deno.inspect, - options: Deno.InspectOptions, - ): string { - const proxy = this._getCustomInspectProxy(); - return "Undo " + inspect(proxy, options); - }; - -// deno-lint-ignore no-explicit-any -(Undo.prototype as any)[Symbol.for("nodejs.util.inspect.custom")] = - function ( - this: Undo, - _depth: number, - options: unknown, - inspect: (value: unknown, options: unknown) => string, - ): string { - const proxy = this._getCustomInspectProxy(); - return "Undo " + inspect(proxy, options); - }; - /** Indicates that the \`actor\` has updated the \`object\`. Note, however, - * that this vocabulary does not define a mechanism for describing the actual - * set of modifications made to \`object\`. - * - * The \`target\` and \`origin\` typically have no defined meaning. - * - */ -export class Update extends Activity { - - /** - * The type URI of {@link Update}: \`https://www.w3.org/ns/activitystreams#Update\`. - */ - static override get typeId(): URL { - return new URL("https://www.w3.org/ns/activitystreams#Update"); - } - - /** - * Constructs a new instance of Update with the given values. - * @param values The values to initialize the instance with. - * @param options The options to use for initialization. - */ - constructor( - values: - { -id?: URL | null; -attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; -attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; -audiences?: (Object | URL)[];content?: string | LanguageString | null; -contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; -names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; -icons?: (Image | URL)[];image?: Image | URL | null; -images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; -replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; -locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; -previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; -summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; -urls?: ((URL | Link))[];to?: Object | URL | null; -tos?: (Object | URL)[];bto?: Object | URL | null; -btos?: (Object | URL)[];cc?: Object | URL | null; -ccs?: (Object | URL)[];bcc?: Object | URL | null; -bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; -actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; -objects?: (Object | URL)[];target?: Object | URL | null; -targets?: (Object | URL)[];result?: Object | URL | null; -results?: (Object | URL)[];origin?: Object | URL | null; -origins?: (Object | URL)[];instrument?: Object | URL | null; -instruments?: (Object | URL)[];} -, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, - verifyPortableObject?: PortableObjectVerifier, - } = {}, - ) { - super(values, options);} - - /** - * Clones this instance, optionally updating it with the given values. - * - * This is a shallow copy: property arrays are copied, but nested objects - * and URLs are shared with this instance. Dereferencing accessors can cache - * fetched objects in the instance whose accessor is called. Hydrating a - * shared nested object through the clone can affect the original as well, - * and can change JSON-LD output when either is embedded in another - * object. Hydrating a top-level property of the clone does not update this - * instance's property. - * - * To resolve properties without sharing nested objects, use - * {@link Update.deepClone} before hydration. - * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) - * for details, including how cached JSON-LD affects serialization. - * - * A clone never inherits a signed JSON-LD representation retained by - * \`signObject()\`: the clone may differ from the document that the proof - * covers, so embedding the original secured JSON in a parent document - * would be wrong. Sign the clone again if it has to be embedded as a - * secured child. - * - * @param values The values to update the clone with. - * @param options The options to use for cloning. - * @returns The cloned instance with its own property arrays. Nested objects - * and URLs are shared with this instance. - */ - override clone( - values: - { -id?: URL | null; -attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; -attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; -audiences?: (Object | URL)[];content?: string | LanguageString | null; -contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; -names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; -icons?: (Image | URL)[];image?: Image | URL | null; -images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; -replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; -locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; -previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; -summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; -urls?: ((URL | Link))[];to?: Object | URL | null; -tos?: (Object | URL)[];bto?: Object | URL | null; -btos?: (Object | URL)[];cc?: Object | URL | null; -ccs?: (Object | URL)[];bcc?: Object | URL | null; -bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; -actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; -objects?: (Object | URL)[];target?: Object | URL | null; -targets?: (Object | URL)[];result?: Object | URL | null; -results?: (Object | URL)[];origin?: Object | URL | null; -origins?: (Object | URL)[];instrument?: Object | URL | null; -instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): Update { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: $warning is not recognized as a property, but it is. - options = { ...options, $warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as Update; - return clone; - } - - /** - * Copies this instance and its nested vocabulary objects, optionally - * replacing property values. Replacement values are copied too. - * - * Property arrays, URLs and byte arrays are independent of the source. - * Repeated references remain shared within the copy. References to this - * source in replacement values receive a separate copy of its pre-update - * values, rather than referring back to the updated root. - * Other scalar values, including opaque cryptographic keys, are shared. - * - * Each copied object retains its own default loaders, tracer, verifier - * and base URL. Options override defaults only on the root instance. - * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. - * - * Trust and portable provenance follow clone() rules at every level. - * Historical referrers within the graph are copied without replacements; - * referrers outside the graph still point at the original external objects. - * Custom clone() overrides must return fresh, compatible instances and - * remain responsible for their own constructor and cloning side effects. - * Large sparse property arrays with ordinary data entries are copied using - * a snapshot of their length and present indices. Entries added after a - * snapshot are not visited; deleted entries are skipped, and values changed - * after the snapshot are read when reached. Custom - * clone() overrides must avoid structurally changing a field being copied - * if they need all its nested objects to be independent of the source. - * - * @param values The values to replace before copying the graph. - * @param options Root loader and verifier overrides. Undefined options - * retain the corresponding defaults. - * @returns An independent copy of the stored vocabulary graph. - * @since 2.5.0 - */ - override deepClone(values: -{ -id?: URL | null; -attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; -attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; -audiences?: (Object | URL)[];content?: string | LanguageString | null; -contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; -names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; -icons?: (Image | URL)[];image?: Image | URL | null; -images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; -replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; -locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; -previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; -summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; -urls?: ((URL | Link))[];to?: Object | URL | null; -tos?: (Object | URL)[];bto?: Object | URL | null; -btos?: (Object | URL)[];cc?: Object | URL | null; -ccs?: (Object | URL)[];bcc?: Object | URL | null; -bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; -proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; -actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; -objects?: (Object | URL)[];target?: Object | URL | null; -targets?: (Object | URL)[];result?: Object | URL | null; -results?: (Object | URL)[];origin?: Object | URL | null; -origins?: (Object | URL)[];instrument?: Object | URL | null; -instruments?: (Object | URL)[];} -= {}, options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {}): Update { - const cloneOptions = { - documentLoader: options.documentLoader ?? this._documentLoader, - contextLoader: options.contextLoader ?? this._contextLoader, - verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, - tracerProvider: this._tracerProvider, - baseUrl: this._baseUrl, - }; - return deepCloneGraph(this, this.clone(values, cloneOptions)); - } - - /** - * Converts this object to a JSON-LD structure. - * @param options The options to use. - * - \`format\`: The format of the output: \`compact\` or - \`expand\`. - * - \`contextLoader\`: The loader for remote JSON-LD contexts. - * - \`context\`: The JSON-LD context to use. Not applicable - when \`format\` is set to \`'expand'\`. - * @returns The JSON-LD representation of this object. - */ - override async toJsonLd(options: { - format?: "compact" | "expand", - contextLoader?: DocumentLoader, - context?: string | Record | (string | Record)[], - } = {}): Promise { - if (options.format == null && this._cachedJsonLd != null) { - return this._cachedJsonLd; - } - if (options.format !== "compact" && options.context != null) { - throw new TypeError( - "The context option can only be used when the format option is set " + - "to 'compact'." - ); - } - options = { - ...options, - contextLoader: options.contextLoader ?? getDocumentLoader(), - }; - // Joins the enclosing frame's signed-value scope, or starts one when this - // frame is the outermost. Only the owning frame puts retained signed - // child documents back in place of their placeholders. - const signedValues = enterSignedValueScope(options); - - // deno-lint-ignore no-unused-vars prefer-const - let array: unknown[]; - - const baseValues = await super.toJsonLd({ - ...options, - format: "expand", - context: undefined, - }) as unknown[]; - const values = baseValues[0] as Record< - string, - unknown[] | { "@list": unknown[] } | string - >; - - values["@type"] = ["https://www.w3.org/ns/activitystreams#Update"]; - if (this.id != null) values["@id"] = formatIri(this.id); - if (options.format === "expand") { - return await jsonld.expand( + const retained = retainRawProperties( values, - { - documentLoader: options.contextLoader, - keepFreeFloatingNodes: true, - }, - ); - } - let docContext: Parameters[1] = options.context ?? - ["https://w3id.org/identity/v1","https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","sensitive":"as:sensitive","movedTo":{"@id":"as:movedTo","@type":"@id"},"quoteUrl":"as:quoteUrl","toot":"http://joinmastodon.org/ns#","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","attributionDomains":{"@id":"toot:attributionDomains","@container":"@set"},"votersCount":{"@id":"toot:votersCount","@type":"http://www.w3.org/2001/XMLSchema#nonNegativeInteger"},"Emoji":"toot:Emoji","Hashtag":"as:Hashtag","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","ChatMessage":"http://litepub.social/ns#ChatMessage","quote":{"@id":"https://w3id.org/fep/044f#quote","@type":"@id"},"fedibird":"http://fedibird.com/ns#","quoteUri":"fedibird:quoteUri","QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization","QuoteRequest":"https://w3id.org/fep/044f#QuoteRequest","quoteAuthorization":{"@id":"https://w3id.org/fep/044f#quoteAuthorization","@type":"@id"},"misskey":"https://misskey-hub.net/ns#","_misskey_quote":"misskey:_misskey_quote","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat","emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; - - if (options.context == null) { - const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; - const additionalContexts = getExtraContexts(values).filter( - context => !currentContexts.includes(context) - ); - if (additionalContexts.length > 0) { - docContext = [...currentContexts, ...additionalContexts]; - } - } - - let compacted = await jsonld.compact( - values, - docContext, - { documentLoader: options.contextLoader }, - ); - - if (options.context == null) { - const currentContexts = Array.isArray(docContext) ? docContext : [docContext]; - const additionalContexts = getExtraContexts(compacted).filter( - context => !currentContexts.includes(context) + Update.#knownRawPropertyIris, ); - if (additionalContexts.length > 0) { - docContext = [...currentContexts, ...additionalContexts]; - compacted = await jsonld.compact(values, docContext, { - documentLoader: options.contextLoader, - }); - } - } - - if (docContext != null) { - // Embed context - - if ("proof" in compacted && - compacted.proof != null) { - if (Array.isArray(compacted.proof)) { - for (const element of compacted.proof) { - element["@context"] = docContext; - } - } else { - compacted.proof["@context"] = docContext; - } - } - + if (retained != null) retainedRawProperties.set(instance, retained); } - return signedValues.owner - ? resolveSignedValues(compacted, signedValues.scope) - : compacted; - } - - protected override isCompactable(): boolean { - - return super.isCompactable(); - } - - /** - * Converts a JSON-LD structure to an object of this type. - * @param json The JSON-LD structure to convert. - * @param options The options to use. - * - \`documentLoader\`: The loader for remote JSON-LD documents. - * - \`contextLoader\`: The loader for remote JSON-LD contexts. - * - \`tracerProvider\`: The OpenTelemetry tracer provider to use. - * If omitted, the global tracer provider is used. - * - \`verifyPortableObject\`: The default FEP-ef61 portable - * object verifier for the property accessors of the - * returned object and the objects obtained from it. It - * does not verify the given \`json\` itself. - * @returns The object of this type. - * @throws {TypeError} If the given \`json\` is invalid. - */ - static override async fromJsonLd( - json: unknown, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, - verifyPortableObject?: PortableObjectVerifier, - baseUrl?: URL, - } = {}, - ): Promise { - const tracerProvider = options.tracerProvider ?? trace.getTracerProvider(); - const tracer = tracerProvider.getTracer( - "@fedify/vocab-tools", - "0.0.0", - ); - return await tracer.startActiveSpan( - "activitypub.parse_object", - async (span) => { - try { - const object = await this.__fromJsonLd__Update__( - json, span, options); - if (object.id != null) { - span.setAttribute("activitypub.object.id", object.id.href); - } - return object; - } catch (error) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: String(error), - }); - throw error; - } finally { - span.end(); - } - }, - ); - } - - protected static async __fromJsonLd__Update__( - json: unknown, - span: Span, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, - verifyPortableObject?: PortableObjectVerifier, - baseUrl?: URL, - } = {}, - ): Promise { - if (typeof json === "undefined") { - throw new TypeError("Invalid JSON-LD: undefined."); - } - else if (json === null) throw new TypeError("Invalid JSON-LD: null."); - options = { - ...options, - documentLoader: options.documentLoader ?? getDocumentLoader(), - contextLoader: options.contextLoader ?? getDocumentLoader(), - tracerProvider: options.tracerProvider ?? trace.getTracerProvider(), - }; - // deno-lint-ignore no-explicit-any - let values: Record & { "@id"?: string }; - let expanded: unknown[]; - if ( - "_fromSubclass" in options && - options._fromSubclass && - typeof json === "object" && - !Array.isArray(json) - ) { - values = - // deno-lint-ignore no-explicit-any - json as (Record & { "@id"?: string }); - expanded = [values]; - } else if (globalThis.Object.keys(json).length == 0) { - values = {}; - expanded = [values]; - } else { - expanded = await jsonld.expand(json, { - documentLoader: options.contextLoader, - keepFreeFloatingNodes: true, - }); - values = - // deno-lint-ignore no-explicit-any - (expanded[0] ?? {}) as (Record & { "@id"?: string }); - } - const id = parseJsonLdId(values["@id"], options.baseUrl); - if (id != null && options.baseUrl == null) { - options = { ...options, baseUrl: id }; - } - - if ("@type" in values) { - span.setAttribute("activitypub.object.type", values["@type"]); - } - if ("@type" in values && - !values["@type"].every(t => t.startsWith("_:"))) { - - if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Update")) { - throw new TypeError("Invalid type: " + values["@type"]); - } - } - - let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizeJsonLdIris( - expanded, - PORTABLE_IRI_KEYS, - PORTABLE_IRI_PATTERN, - ) - : undefined; - if (cacheJsonLd != null && cacheJsonLd !== expanded) { - cacheJsonLd = structuredClone(cacheJsonLd); - } - - const superValues = structuredClone(values); - delete superValues["@type"]; - const instance = await super.fromJsonLd(superValues, { - ...options, - // @ts-ignore: an internal option - _fromSubclass: true, - }); - if (!(instance instanceof Update)) { - throw new TypeError("Unexpected type: " + instance.constructor.name); - } - - let shouldCacheJsonLd = instance._shouldCacheJsonLd; - instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -168222,6 +184146,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -168287,9 +184215,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -168477,6 +184406,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#height","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/activitystreams#width","https://www.w3.org/ns/credentials/v2#digestMultibase"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -168609,6 +184540,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof Video)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -168616,6 +184550,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + Video.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && @@ -168744,6 +184688,10 @@ instruments?: (Object | URL)[];} * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -168815,9 +184763,10 @@ instruments?: (Object | URL)[];} * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; @@ -168992,6 +184941,8 @@ instruments?: (Object | URL)[];} return super.isCompactable(); } + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://purl.org/dc/terms/license","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/security#proof","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url"]); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -169124,6 +185075,9 @@ instruments?: (Object | URL)[];} ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof View)) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -169131,6 +185085,16 @@ instruments?: (Object | URL)[];} let shouldCacheJsonLd = instance._shouldCacheJsonLd; + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + View.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index ef1d497ad..cb6e21a63 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -11,6 +11,10 @@ import { import { generateFields } from "./field.ts"; import { generateInspector, generateInspectorPostClass } from "./inspector.ts"; import { generateProperties } from "./property.ts"; +import { + generateRawPropertyDescriptors, + generateRawPropertyHelpers, +} from "./raw-property.ts"; import { generatePropertyArrayHelpers } from "./property-array.ts"; import { type PropertySchema, @@ -49,6 +53,16 @@ const PORTABLE_DEREFERENCE_IMPORTS = [ "rejectMalformedCompatibleReference", "warnUnverifiableEmbeddedObject", ].join(",\n "); +const RAW_PROPERTY_IMPORTS = [ + "createRawPropertyEncodingOptions", + "encodeNestedVocabularyValue", + "expandRawPropertyValue", + "RAW_PROPERTY_PROTOCOL", + "type RawPropertyRequest", + "readRawPropertyValues", + "retainRawProperties", + "type RetainedRawProperties", +].join(",\n "); const SIGNED_REPRESENTATION_IMPORTS = [ "enterSignedValueScope", "resolveSignedValues", @@ -75,7 +89,9 @@ const RUNTIME_IMPORTS = [ "parseIri", "parseJsonLdId", "type PortableObjectVerifier", + "type RawPropertyValue", "type RemoteDocument", + "type VocabularyObject", ].join(",\n "); /** @@ -117,7 +133,7 @@ async function* generateClass( const baseType = types[type.extends]; yield `export class ${type.name} extends ${baseType.name} {\n`; } else { - yield `export class ${type.name} {\n`; + yield `export class ${type.name} implements VocabularyObject {\n`; } if (type.extends == null) { yield ` @@ -135,6 +151,14 @@ async function* generateClass( #shouldCacheJsonLd = true; readonly id: URL | null; + /** + * Marks this object as a {@link VocabularyObject}. It is always \`true\`. + * @since 2.5.0 + */ + get "~fedify.vocab"(): true { + return true; + } + protected get _documentLoader(): DocumentLoader | undefined { return this.#documentLoader; } @@ -208,6 +232,9 @@ async function* generateClass( for await (const code of generateDeepCloneDescriptor(typeUri, types)) { yield code.replace(/[ \t]+$/gm, ""); } + for await (const code of generateRawPropertyDescriptors(typeUri, types)) { + yield code.replace(/[ \t]+$/gm, ""); + } for await (const code of generateProperties(typeUri, types, moduleVarNames)) { yield code; } @@ -324,6 +351,7 @@ export async function* generateClasses( yield `import {\n ${RUNTIME_IMPORTS}\n} from "@fedify/vocab-runtime";\n`; yield `import {\n ${INTERNAL_RUNTIME_IMPORTS}\n} from "@fedify/vocab-runtime/internal/jsonld-cache";\n`; yield `import {\n ${PORTABLE_DEREFERENCE_IMPORTS}\n} from "@fedify/vocab-runtime/internal/portable-dereference";\n`; + yield `import {\n ${RAW_PROPERTY_IMPORTS}\n} from "@fedify/vocab-runtime/internal/raw-property";\n`; yield `import {\n ${SIGNED_REPRESENTATION_IMPORTS}\n} from "@fedify/vocab-runtime/internal/signed-representation";\n`; yield `import { isTemporalDuration, @@ -348,6 +376,7 @@ function inspectIri(iri: URL): string { `; yield generatePropertyArrayHelpers(); yield generateDeepCloneHelpers(); + yield generateRawPropertyHelpers(); yield ` function isValidLanguageTag(language: string): boolean { try { diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index eb6db033e..35397f5d9 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -2,6 +2,10 @@ import metadata from "../deno.json" with { type: "json" }; import { generateField, getFieldName } from "./field.ts"; import type { PropertyPreprocessorSchema, TypeSchema } from "./schema.ts"; import { isNonFunctionalProperty } from "./schema.ts"; +import { + generateExpandedPropertyElement, + getKnownPropertyIris, +} from "./raw-property.ts"; import { areAllScalarTypes, emitOverride, @@ -223,29 +227,12 @@ export async function* generateEncoder( yield ` array = []; for (const v of this.${await getFieldName(property.uri)}) { - let element = ( `; - if (!areAllScalarTypes(property.range, types)) { - yield "retainedSignedValueRef(v, signedValues.scope) ?? ("; - yield 'v instanceof URL ? { "@id": formatIri(v) } : '; - } - for (const code of getEncoders(property.range, types, "v", "options")) { - yield code; - } - if (!areAllScalarTypes(property.range, types)) yield ")"; - yield ` - ); - if (Array.isArray(element)) { - if (element.length < 1) continue; - if (element.length == 1) element = element[0]; - } - if (typeof element === "undefined") continue; - `; - if (isNonFunctionalProperty(property) && property.container === "graph") { - yield `array.push({ "@graph": element });`; - } else { - yield `array.push(element);`; - } + yield* generateExpandedPropertyElement( + property, + types, + "signedValues.scope", + ); yield `; } if (array.length > 0) { @@ -400,6 +387,10 @@ export async function* generateDecoder( ): AsyncIterable { const type = types[typeUri]; yield ` + static readonly #knownRawPropertyIris: ReadonlySet = new Set(${ + JSON.stringify(getKnownPropertyIris(typeUri, types)) + }); + /** * Converts a JSON-LD structure to an object of this type. * @param json The JSON-LD structure to convert. @@ -554,6 +545,9 @@ export async function* generateDecoder( ...options, // @ts-ignore: an internal option _fromSubclass: true, + // The subclass retains the unknown properties, since only it knows all + // properties of the object: + _retainsRawProperties: false, }); if (!(instance instanceof ${type.name})) { throw new TypeError("Unexpected type: " + instance.constructor.name); @@ -671,6 +665,16 @@ export async function* generateDecoder( `; } yield ` + if ( + !("_retainsRawProperties" in options) || + options._retainsRawProperties !== false + ) { + const retained = retainRawProperties( + values, + ${type.name}.#knownRawPropertyIris, + ); + if (retained != null) retainedRawProperties.set(instance, retained); + } instance._shouldCacheJsonLd = shouldCacheJsonLd; if ( shouldCacheJsonLd && diff --git a/packages/vocab-tools/src/constructor.ts b/packages/vocab-tools/src/constructor.ts index 5d14e7eaf..5ab946a42 100644 --- a/packages/vocab-tools/src/constructor.ts +++ b/packages/vocab-tools/src/constructor.ts @@ -259,6 +259,10 @@ export async function* generateCloner( * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * + * Unknown properties retained when this instance was decoded are shared + * with the clone, so \`getRawPropertyValues()\` returns them for the clone + * as well, even if the clone replaces other values. + * * A clone never inherits a signed JSON-LD representation retained by * \`signObject()\`: the clone may differ from the document that the proof * covers, so embedding the original secured JSON in a parent document @@ -299,6 +303,7 @@ export async function* generateCloner( options ); copyPortableProvenance(this, clone); + copyRawProperties(this, clone); `; } else { yield `const clone = super.clone(values, options) as unknown as ${type.name};`; @@ -422,9 +427,10 @@ export async function* generateDeepCloner( * Each copied object retains its own default loaders, tracer, verifier * and base URL. Options override defaults only on the root instance. * This method does not fetch or serialize objects. Cached JSON-LD and - * retained signed representations are not copied; unknown JSON-LD - * properties and original formatting are not preserved. Sign the copy - * again if it needs a valid proof. + * retained signed representations are not copied, and original formatting + * is not preserved. Unknown properties retained when an object was decoded + * are shared with its copy, so \`getRawPropertyValues()\` returns them for + * the copy as well. Sign the copy again if it needs a valid proof. * * Trust and portable provenance follow clone() rules at every level. * Historical referrers within the graph are copied without replacements; diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index 4d2a9e7b7..5cbc8b545 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -491,12 +491,17 @@ async function* generateProperty( const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const decoded = v; v = await this.#${property.singularName}_fromJsonLd(doc, { ...options, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: ${cachedPropertyBaseUrl}, }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -672,12 +677,17 @@ async function* generateProperty( const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const decoded = v; v = await this.#${property.singularName}_fromJsonLd(obj, { ...options, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: ${cachedPropertyBaseUrl}, }); + // The cached document lacks the parent's context, so the + // unknown properties retained from the whole document, including + // those of nested objects, win: + copyRawPropertiesDeep(decoded, v); } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts new file mode 100644 index 000000000..bfdcacbb5 --- /dev/null +++ b/packages/vocab-tools/src/raw-property.ts @@ -0,0 +1,374 @@ +import { getFieldName } from "./field.ts"; +import { + isNonFunctionalProperty, + type PropertySchema, + type TypeSchema, +} from "./schema.ts"; +import { areAllScalarTypes, getAllProperties, getEncoders } from "./type.ts"; + +/** + * Emits the body of a loop that encodes the values of a property into the + * shape that `toJsonLd({ format: "expand" })` passes to `jsonld.expand()`. + * The loop pushes encoded values into a local `array`, and expects the + * current value in `v` and the encoding options in `options`. + * @param property The property to encode. + * @param types The type schemas. + * @param signedValueScope The expression of the signed-value scope whose + * placeholders should replace retained signed values, + * or `undefined` to encode them as they are. + * @returns The code of the loop body. + */ +export function* generateExpandedPropertyElement( + property: PropertySchema, + types: Record, + signedValueScope?: string, +): Iterable { + yield ` + let element = ( + `; + const scalar = areAllScalarTypes(property.range, types); + if (!scalar) { + if (signedValueScope != null) { + yield `retainedSignedValueRef(v, ${signedValueScope}) ?? (`; + } + yield 'v instanceof URL ? { "@id": formatIri(v) } : '; + } + for (const code of getEncoders(property.range, types, "v", "options")) { + yield code; + } + if (!scalar && signedValueScope != null) yield ")"; + yield ` + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; + `; + if (isNonFunctionalProperty(property) && property.container === "graph") { + yield `array.push({ "@graph": element });`; + } else { + yield `array.push(element);`; + } +} + +/** + * Emits module-private support for the raw property functions, shared by all + * generated classes, and the public functions themselves. + */ +export function generateRawPropertyHelpers(): string { + return ` +type RawPropertyEncoder = ( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, +) => Promise; + +interface RawPropertyDescriptor { + readonly canonicalIri: string; + readonly encode: RawPropertyEncoder; + readonly values: (object: object) => readonly unknown[]; +} + +// Unknown properties retained while decoding, keyed by the decoded object: +const retainedRawProperties = new WeakMap(); + +// Encoders of the properties each generated class declares, keyed by the +// class's prototype and then by the property IRIs, including aliases: +const rawPropertyDescriptors = new Map< + object, + ReadonlyMap +>(); + +function getRawPropertyDescriptor( + object: object, + iri: string, +): RawPropertyDescriptor | undefined { + let prototype: object | null = globalThis.Object.getPrototypeOf(object); + while (prototype != null) { + const descriptor = rawPropertyDescriptors.get(prototype)?.get(iri); + if (descriptor != null) return descriptor; + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return undefined; +} + +function copyRawProperties(source: object, destination: object): void { + const retained = retainedRawProperties.get(source); + if (retained == null) retainedRawProperties.delete(destination); + else retainedRawProperties.set(destination, retained); +} + +function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { + if ( + source == null || destination == null || + typeof source !== "object" || typeof destination !== "object" || + !(RAW_PROPERTY_PROTOCOL in source) || + globalThis.Object.getPrototypeOf(source) !== + globalThis.Object.getPrototypeOf(destination) + ) { + return false; + } + const sourceId = (source as unknown as { id: URL | null }).id; + const destinationId = (destination as unknown as { id: URL | null }).id; + return sourceId?.href === destinationId?.href; +} + +// Copies the retained unknown properties of a decoded object and of the +// objects nested in it to a copy of the same graph that was decoded again, +// pairing nested objects by property and position: +function copyRawPropertiesDeep( + source: object, + destination: object, + visited: Set = new Set(), +): void { + if (visited.has(destination)) return; + visited.add(destination); + copyRawProperties(source, destination); + if (!isSameRawPropertyNode(source, destination)) return; + const descriptors = new Set(); + let prototype: object | null = globalThis.Object.getPrototypeOf(destination); + while (prototype != null) { + for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { + descriptors.add(descriptor); + } + prototype = globalThis.Object.getPrototypeOf(prototype); + } + for (const descriptor of descriptors) { + const sources = descriptor.values(source); + const destinations = descriptor.values(destination); + const length = globalThis.Math.min(sources.length, destinations.length); + for (let i = 0; i < length; i++) { + if ( + sources[i] !== destinations[i] && + isSameRawPropertyNode(sources[i], destinations[i]) + ) { + copyRawPropertiesDeep( + sources[i] as object, + destinations[i] as object, + visited, + ); + } + } + } +} + +async function readRawProperty( + object: object, + request: RawPropertyRequest, + contextLoader: DocumentLoader, +): Promise { + const retained = retainedRawProperties.get(object); + for (const iri of request.candidates) { + const descriptor = getRawPropertyDescriptor(object, iri); + if (descriptor != null) { + const value = await descriptor.encode( + object, + createRawPropertyEncodingOptions(request.stack, contextLoader), + ); + return value === undefined ? [] : await expandRawPropertyValue( + descriptor.canonicalIri, + value, + contextLoader, + ); + } + if (retained != null && globalThis.Object.hasOwn(retained, iri)) { + return retained[iri]; + } + } + return []; +} + +/** + * Gets the values of a property of a vocabulary object in expanded JSON-LD, + * looking the property up by its full IRI. This works for properties that + * have no typed accessor as well as for those that do. + * + * *Raw* means untyped expanded JSON-LD values, such as + * \`{ "@value": "Hello" }\` or \`{ "@id": "https://example.com/" }\`, as + * opposed to the values that typed accessors return. It does not mean the + * received document: + * + * - For a property that the object's class has no accessor for, the result + * is the values retained when the object was decoded by \`fromJsonLd()\`. + * Objects constructed locally have none. + * - For a property that the class has an accessor for, including a + * redundant alias of such a property, the result is the current typed + * values encoded back into expanded JSON-LD. It reflects \`clone()\` + * replacements and objects fetched by dereferencing accessors, and it can + * differ from the received values: for example, values that failed to + * decode are missing, and lexical forms such as date-times are + * normalized. When a later release adds an accessor for a property, + * the result for that property switches from the retained values to the + * encoded ones. + * + * The values are not verified in any way, and IRIs in them are never + * dereferenced. Validate them before use, as with any other data received + * from a remote server. The result is a deep copy, so modifying it does not + * affect the object. + * + * The IRI is matched as given, and then as normalized by the WHATWG URL + * parser. Prefixes are never expanded: \`"as:content"\` is a valid IRI with + * the \`as:\` scheme, so it normally matches nothing. An IRI whose scheme is + * not \`http:\` or \`https:\` is therefore logged as a warning under the + * \`["fedify", "vocab"]\` category. + * + * \`\`\`typescript ignore + * const values = await getRawPropertyValues( + * note, + * "https://w3id.org/quantpub#structuredUrl", + * ); + * for (const value of values) { + * if ("@id" in value && typeof value["@id"] === "string") { + * console.log(new URL(value["@id"])); + * } + * } + * \`\`\` + * + * @param object The vocabulary object to read. It can be an object of any + * module generated by \`@fedify/vocab-tools\`. + * @param propertyIri The full IRI of the property. + * @returns The values of the property, or an empty array if it has none. + * @throws {TypeError} If \`propertyIri\` is not an absolute IRI, e.g., an + * empty string, a JSON-LD keyword such as \`"@id"\`, a + * blank node identifier, a term, or a relative + * reference; if \`object\` is not a generated vocabulary + * object; or if encoding the values of a known property + * meets a cycle of objects. + * @since 2.5.0 + */ +export function getRawPropertyValues( + object: VocabularyObject, + propertyIri: string | URL, +): Promise { + return readRawPropertyValues(object, propertyIri, "getRawPropertyValues"); +} + +/** + * Gets the first value of a property of a vocabulary object in expanded + * JSON-LD, looking the property up by its full IRI. It is equivalent to + * \`(await getRawPropertyValues(object, propertyIri))[0] ?? null\`; see + * {@link getRawPropertyValues} for how the values are obtained. + * + * It does not throw when the property has multiple values. JSON-LD does not + * order the values of a property unless it is a list, so the first value is + * not more significant than the others. A list property has a single value, + * the \`{ "@list": [...] }\` object. + * + * @param object The vocabulary object to read. It can be an object of any + * module generated by \`@fedify/vocab-tools\`. + * @param propertyIri The full IRI of the property. + * @returns The first value of the property, or \`null\` if it has none. + * @throws {TypeError} In the same cases as {@link getRawPropertyValues}. + * @since 2.5.0 + */ +export async function getRawPropertyValue( + object: VocabularyObject, + propertyIri: string | URL, +): Promise { + const values = await readRawPropertyValues( + object, + propertyIri, + "getRawPropertyValue", + ); + return values[0] ?? null; +} +`; +} + +/** + * Collects the full IRIs of the properties that the given class decodes, + * including inherited properties and redundant aliases. + */ +export function getKnownPropertyIris( + typeUri: string, + types: Record, +): string[] { + const iris = new Set(); + for (const property of getAllProperties(typeUri, types)) { + iris.add(property.uri); + if (property.redundantProperties != null) { + for (const alias of property.redundantProperties) iris.add(alias.uri); + } + } + return [...iris].sort(); +} + +/** + * Emits a static block that registers the encoders of the properties the + * given class declares, keeping them and their private-field access out of + * the declaration files. A root class also installs the method through which + * the raw property functions reach these encoders and the retained unknown + * properties. + */ +export async function* generateRawPropertyDescriptors( + typeUri: string, + types: Record, +): AsyncIterable { + const type = types[typeUri]; + if (type.extends != null && type.properties.length < 1) return; + yield "static {\n"; + if (type.extends == null) { + yield ` + globalThis.Object.defineProperty(this.prototype, RAW_PROPERTY_PROTOCOL, { + value: function ( + this: ${type.name}, + request: RawPropertyRequest, + ): Promise { + return readRawProperty( + this, + request, + this.#contextLoader ?? getDocumentLoader(), + ); + }, + configurable: true, + enumerable: false, + writable: true, + }); + `; + } + if (type.properties.length > 0) { + yield ` + const descriptors = new Map(); + let descriptor: RawPropertyDescriptor; + `; + } + for (const property of type.properties) { + yield ` + descriptor = { + canonicalIri: ${JSON.stringify(property.uri)}, + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as ${type.name}).${await getFieldName( + property.uri, + )}) { + `; + yield* generateExpandedPropertyElement(property, types); + yield ` + } + if (array.length < 1) return undefined; + return ${ + isNonFunctionalProperty(property) && property.container === "list" + ? `{ "@list": array }` + : "array" + }; + }, + values(object: object): readonly unknown[] { + return (object as ${type.name}).${await getFieldName(property.uri)}; + }, + }; + descriptors.set(${JSON.stringify(property.uri)}, descriptor); + `; + for (const alias of property.redundantProperties ?? []) { + yield `descriptors.set(${JSON.stringify(alias.uri)}, descriptor);\n`; + } + } + if (type.properties.length > 0) { + yield "rawPropertyDescriptors.set(this.prototype, descriptors);\n"; + } + yield "}\n"; +} diff --git a/packages/vocab-tools/src/type.ts b/packages/vocab-tools/src/type.ts index 5e39b0807..500ff85b0 100644 --- a/packages/vocab-tools/src/type.ts +++ b/packages/vocab-tools/src/type.ts @@ -622,7 +622,11 @@ export function getEncoder( format: undefined, context: undefined, })` - : `await ${variable}.toJsonLd(${optionsVariable})`; + : `await encodeNestedVocabularyValue( + ${optionsVariable}, + ${variable}, + () => ${variable}.toJsonLd(${optionsVariable}), + )`; } throw new Error(`Unknown type: ${typeUri}`); } @@ -677,9 +681,16 @@ export function getDecoder( ); } if (typeUri in types) { + // An embedded value is another object, which retains its own unknown + // properties even when it is decoded by a superclass of its parent: return `await ${types[typeUri].name}.fromJsonLd( ${variable}, - { ...${optionsVariable}, baseUrl: ${baseUrlVariable} } + { + ...${optionsVariable}, + baseUrl: ${baseUrlVariable}, + // @ts-ignore: an internal option + _retainsRawProperties: true, + } )`; } throw new Error(`Unknown type: ${typeUri}`); diff --git a/packages/vocab/src/mod.ts b/packages/vocab/src/mod.ts index f30b7b148..0a6e270df 100644 --- a/packages/vocab/src/mod.ts +++ b/packages/vocab/src/mod.ts @@ -69,5 +69,10 @@ export type { PortableObjectVerifierOptions, PropertyPreprocessor, PropertyPreprocessorContext, + RawListObject, + RawNodeObject, + RawPropertyValue, + RawValueObject, RemoteDocument, + VocabularyObject, } from "@fedify/vocab-runtime"; diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts new file mode 100644 index 000000000..ff40b1e56 --- /dev/null +++ b/packages/vocab/src/raw-property.test.ts @@ -0,0 +1,396 @@ +import { test } from "@fedify/fixture"; +import { LanguageString } from "@fedify/vocab-runtime"; +import { configure, type LogRecord, reset } from "@logtape/logtape"; +import { deepStrictEqual, ok, rejects, strictEqual } from "node:assert/strict"; +import { + Create, + getRawPropertyValue, + getRawPropertyValues, + Note, + Object as ASObject, + Person, + Question, +} from "./mod.ts"; + +const AS = "https://www.w3.org/ns/activitystreams"; +const QUANT = "https://w3id.org/quantpub#"; +const STRUCTURED_URL = `${QUANT}structuredUrl`; + +const structuredNote = { + "@context": [AS, { quant: QUANT }], + id: "https://example.com/notes/1", + type: "Note", + content: "Hello", + "quant:structuredUrl": { "@id": "https://example.com/data/1?token=abc" }, +}; + +test("getRawPropertyValues() reads an unknown property", async () => { + const note = await Note.fromJsonLd(structuredNote); + deepStrictEqual(await getRawPropertyValues(note, STRUCTURED_URL), [ + { "@id": "https://example.com/data/1?token=abc" }, + ]); + deepStrictEqual( + await getRawPropertyValues(note, new URL(STRUCTURED_URL)), + [{ "@id": "https://example.com/data/1?token=abc" }], + ); + deepStrictEqual(await getRawPropertyValues(note, `${QUANT}missing`), []); + deepStrictEqual(await getRawPropertyValue(note, STRUCTURED_URL), { + "@id": "https://example.com/data/1?token=abc", + }); + strictEqual(await getRawPropertyValue(note, `${QUANT}missing`), null); +}); + +test("getRawPropertyValues() is independent of prefixes", async () => { + const note = await Note.fromJsonLd({ + "@context": [AS, { q: QUANT, url2: `${QUANT}structuredUrl` }], + type: "Note", + "q:structuredUrl": { "@id": "https://example.com/a" }, + url2: { "@id": "https://example.com/b" }, + }); + deepStrictEqual(await getRawPropertyValues(note, STRUCTURED_URL), [ + { "@id": "https://example.com/a" }, + { "@id": "https://example.com/b" }, + ]); +}); + +test("getRawPropertyValues() reads literals, lists, and JSON", async () => { + const note = await Note.fromJsonLd({ + "@context": [ + AS, + { + quant: QUANT, + "quant:series": { "@container": "@list" }, + "quant:payload": { "@type": "@json" }, + }, + ], + type: "Note", + "quant:label": [{ "@value": "One", "@language": "en" }, "Two", 3], + "quant:series": [1, 2], + "quant:payload": { nested: { value: [true, null] } }, + }); + deepStrictEqual(await getRawPropertyValues(note, `${QUANT}label`), [ + { "@value": "One", "@language": "en" }, + { "@value": "Two" }, + { "@value": 3 }, + ]); + deepStrictEqual(await getRawPropertyValues(note, `${QUANT}series`), [ + { "@list": [{ "@value": 1 }, { "@value": 2 }] }, + ]); + deepStrictEqual(await getRawPropertyValue(note, `${QUANT}series`), { + "@list": [{ "@value": 1 }, { "@value": 2 }], + }); + deepStrictEqual(await getRawPropertyValues(note, `${QUANT}payload`), [ + { "@type": "@json", "@value": { nested: { value: [true, null] } } }, + ]); +}); + +test("getRawPropertyValues() returns deep copies", async () => { + const note = await Note.fromJsonLd({ + "@context": [AS, { quant: QUANT, "quant:payload": { "@type": "@json" } }], + type: "Note", + "quant:payload": { list: [1] }, + }); + const values = await getRawPropertyValues(note, `${QUANT}payload`); + (values[0] as { "@value": { list: number[] } })["@value"].list.push(2); + values.push({ "@value": "extra" }); + deepStrictEqual(await getRawPropertyValues(note, `${QUANT}payload`), [ + { "@type": "@json", "@value": { list: [1] } }, + ]); +}); + +test("getRawPropertyValues() reads embedded objects", async () => { + // The embedded note relies on the parent's context only: + const create = await Create.fromJsonLd({ + "@context": [AS, { quant: QUANT }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + id: "https://example.com/notes/1", + type: "Note", + "quant:structuredUrl": { "@id": "https://example.com/data/1" }, + }, + }); + const note = await create.getObject(); + ok(note instanceof Note); + deepStrictEqual(await getRawPropertyValues(note, STRUCTURED_URL), [ + { "@id": "https://example.com/data/1" }, + ]); + const notes = await Array.fromAsync(create.getObjects()); + deepStrictEqual(await getRawPropertyValues(notes[0], STRUCTURED_URL), [ + { "@id": "https://example.com/data/1" }, + ]); +}); + +test("getRawPropertyValues() reads embedded objects with their own contexts", async () => { + // The prefix comes from the parent, while the embedded note has its own + // context, so the accessors reparse it from the cached JSON-LD: + const create = await Create.fromJsonLd({ + "@context": [AS, { quant: QUANT }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": AS, + id: "https://example.com/notes/1", + type: "Note", + "quant:structuredUrl": { "@id": "https://example.com/data/1" }, + }, + }); + const note = await create.getObject(); + ok(note instanceof Note); + deepStrictEqual(await getRawPropertyValues(note, STRUCTURED_URL), [ + { "@id": "https://example.com/data/1" }, + ]); + const notes = await Array.fromAsync(create.getObjects()); + deepStrictEqual(await getRawPropertyValues(notes[0], STRUCTURED_URL), [ + { "@id": "https://example.com/data/1" }, + ]); +}); + +test("getRawPropertyValues() reads objects nested in reparsed embedded objects", async () => { + const create = await Create.fromJsonLd({ + "@context": [AS, { quant: QUANT }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": AS, + id: "https://example.com/notes/1", + type: "Note", + attachment: { + type: "Document", + "quant:structuredUrl": { "@id": "https://example.com/data/2" }, + }, + }, + }); + const note = await create.getObject(); + ok(note instanceof Note); + const [attachment] = await Array.fromAsync(note.getAttachments()); + ok(attachment != null); + deepStrictEqual(await getRawPropertyValues(attachment, STRUCTURED_URL), [ + { "@id": "https://example.com/data/2" }, + ]); +}); + +test("getRawPropertyValues() keeps unknown properties across copies", async () => { + const note = await Note.fromJsonLd(structuredNote); + const expected = [{ "@id": "https://example.com/data/1?token=abc" }]; + const clone = note.clone({ content: "Edited" }); + deepStrictEqual(await getRawPropertyValues(clone, STRUCTURED_URL), expected); + deepStrictEqual( + await getRawPropertyValues(note.deepClone(), STRUCTURED_URL), + expected, + ); + const reparsed = await Note.fromJsonLd(await note.toJsonLd()); + deepStrictEqual( + await getRawPropertyValues(reparsed, STRUCTURED_URL), + expected, + ); + const expanded = await Note.fromJsonLd( + await clone.toJsonLd({ format: "expand" }), + ); + // Serializing from typed values does not emit unknown properties: + deepStrictEqual(await getRawPropertyValues(expanded, STRUCTURED_URL), []); + deepStrictEqual( + await getRawPropertyValues(new Note({ content: "Hi" }), STRUCTURED_URL), + [], + ); +}); + +test("getRawPropertyValues() keeps unknown properties of partly invalid objects", async () => { + const note = await Note.fromJsonLd({ + ...structuredNote, + // Neither an Image nor a Link, so it is skipped: + icon: 123, + }); + deepStrictEqual(await getRawPropertyValues(note, STRUCTURED_URL), [ + { "@id": "https://example.com/data/1?token=abc" }, + ]); +}); + +test("getRawPropertyValues() encodes known properties", async () => { + const note = await Note.fromJsonLd(structuredNote); + deepStrictEqual(await getRawPropertyValues(note, `${AS}#content`), [ + { "@value": "Hello" }, + ]); + const clone = note.clone({ + contents: ["Edited", new LanguageString("Modifié", "fr")], + attribution: new URL("https://example.com/users/alice"), + }); + deepStrictEqual(await getRawPropertyValues(clone, `${AS}#content`), [ + { "@value": "Edited" }, + { "@value": "Modifié", "@language": "fr" }, + ]); + deepStrictEqual(await getRawPropertyValues(clone, `${AS}#attributedTo`), [ + { "@id": "https://example.com/users/alice" }, + ]); + deepStrictEqual(await getRawPropertyValues(clone, `${AS}#name`), []); +}); + +test("getRawPropertyValues() encodes known object properties", async () => { + const create = new Create({ + id: new URL("https://example.com/activities/1"), + object: new Note({ + id: new URL("https://example.com/notes/1"), + content: "Hello", + }), + }); + deepStrictEqual(await getRawPropertyValues(create, `${AS}#object`), [ + { + "@id": "https://example.com/notes/1", + "@type": [`${AS}#Note`], + [`${AS}#content`]: [{ "@value": "Hello" }], + }, + ]); + const question = new Question({ + exclusiveOptions: [new Note({ name: "A" }), new Note({ name: "B" })], + }); + deepStrictEqual(await getRawPropertyValues(question, `${AS}#oneOf`), [ + { "@type": [`${AS}#Note`], [`${AS}#name`]: [{ "@value": "A" }] }, + { "@type": [`${AS}#Note`], [`${AS}#name`]: [{ "@value": "B" }] }, + ]); +}); + +test("getRawPropertyValues() maps redundant aliases to canonical properties", async () => { + // dcterms:license is written canonically, so the alias is never emitted: + const note = await Note.fromJsonLd({ + "@context": [AS, { schema: "https://schema.org/" }], + type: "Note", + "schema:license": { "@id": "https://creativecommons.org/licenses/by/4.0/" }, + }); + const expected = [{ "@id": "https://creativecommons.org/licenses/by/4.0/" }]; + deepStrictEqual( + await getRawPropertyValues(note, "https://schema.org/license"), + expected, + ); + deepStrictEqual( + await getRawPropertyValues(note, "http://purl.org/dc/terms/license"), + expected, + ); +}); + +test("getRawPropertyValues() classifies properties by the concrete class", async () => { + // A Person does not have Question's oneOf property, so it is retained: + const person = await Person.fromJsonLd({ + "@context": AS, + type: "Person", + oneOf: { type: "Note", name: "A" }, + }); + deepStrictEqual(await getRawPropertyValues(person, `${AS}#oneOf`), [ + { "@type": [`${AS}#Note`], [`${AS}#name`]: [{ "@value": "A" }] }, + ]); + const object = await ASObject.fromJsonLd({ + "@context": [AS, { quant: QUANT }], + type: "Note", + "quant:structuredUrl": { "@id": "https://example.com/data/1" }, + }); + ok(object instanceof Note); + deepStrictEqual(await getRawPropertyValues(object, STRUCTURED_URL), [ + { "@id": "https://example.com/data/1" }, + ]); +}); + +test("getRawPropertyValues() does not resolve relative IRIs of unknown properties", async () => { + // Expansion cannot tell which properties hold IRIs that may be resolved, + // e.g., fedify:absoluteIri values are never resolved, so it gets no base: + const note = await Note.fromJsonLd({ + "@context": [AS, { quant: QUANT }], + type: "Note", + "quant:structuredUrl": { "@id": "data/1" }, + }, { baseUrl: new URL("https://example.com/notes/") }); + deepStrictEqual(await getRawPropertyValues(note, STRUCTURED_URL), [ + { "@id": "data/1" }, + ]); +}); + +test("getRawPropertyValues() matches normalized IRIs", async () => { + const note = await Note.fromJsonLd(structuredNote); + deepStrictEqual( + await getRawPropertyValues(note, "HTTPS://W3ID.org/quantpub#structuredUrl"), + [{ "@id": "https://example.com/data/1?token=abc" }], + ); + deepStrictEqual( + await getRawPropertyValues( + note, + "HTTPS://www.w3.org/ns/activitystreams#content", + ), + [{ "@value": "Hello" }], + ); +}); + +test("getRawPropertyValues() rejects invalid property IRIs", async () => { + const note = await Note.fromJsonLd(structuredNote); + for ( + const iri of [ + "", + "@id", + "@type", + "_:b0", + "content", + "/content", + "#content", + "https://example.com/a b", + "https://example.com/%zz", + "https://example.com/#a#b", + ] + ) { + await rejects(() => getRawPropertyValues(note, iri), TypeError, iri); + } + await rejects( + () => getRawPropertyValues(note, 123 as unknown as string), + TypeError, + ); + await rejects( + () => + getRawPropertyValues( + { + "~fedify.vocab": true, + id: null, + toJsonLd: () => Promise.resolve({}), + }, + STRUCTURED_URL, + ), + TypeError, + ); +}); + +test("getRawPropertyValues() warns about compact IRIs", async () => { + const records: LogRecord[] = []; + await configure({ + sinks: { buffer: (record: LogRecord) => records.push(record) }, + loggers: [ + { category: ["fedify", "vocab"], sinks: ["buffer"] }, + { category: ["logtape", "meta"], sinks: [] }, + ], + reset: true, + }); + try { + const note = await Note.fromJsonLd(structuredNote); + deepStrictEqual(await getRawPropertyValues(note, "as:summary"), []); + deepStrictEqual(await getRawPropertyValues(note, "as:summary"), []); + deepStrictEqual( + await getRawPropertyValues(note, "urn:example:property"), + [], + ); + deepStrictEqual( + await getRawPropertyValues(note, "https://example.com/property"), + [], + ); + strictEqual(records.length, 2); + strictEqual(records[0].level, "warning"); + deepStrictEqual(records[0].properties, { + iri: "as:summary", + scheme: "as", + function: "getRawPropertyValues", + suggestion: `${AS}#summary`, + }); + deepStrictEqual(records[1].properties, { + iri: "urn:example:property", + scheme: "urn", + function: "getRawPropertyValues", + }); + } finally { + await reset(); + } +}); From 4991f9775f90f6d581b8e22829311b8b11c9d369 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 05:22:16 +0900 Subject: [PATCH 03/35] Add the raw-property-iri-invalid lint rule getRawPropertyValues() and getRawPropertyValue() take full property IRIs and never expand prefixes, so a term or a JSON-LD keyword throws at runtime and a compact IRI such as as:content is looked up literally and matches nothing. The new rule reports statically known IRI arguments with these mistakes: string literals, templates without expressions, new URL() calls without a base, normalized as the URL parser does, and const bindings to them. For well-known prefixes it suggests the full IRI. By default it inspects functions imported from @fedify/vocab. With ESLint and Oxlint, the modules option adds other vocabulary modules generated by @fedify/vocab-tools; Deno Lint plugin rules cannot take options, which the manual documents. https://github.com/fedify-dev/fedify/issues/1272 Assisted-by: Claude Code:claude-opus-5-5 Assisted-by: Codex:gpt-6.1-sol Assisted-by: Codex:gpt-6-astra --- CHANGES.md | 11 +- changes.d/lint/raw-property-iri-invalid.md | 11 + docs/manual/lint.md | 74 ++++ packages/lint/README.md | 6 + packages/lint/src/index.ts | 3 + packages/lint/src/lib/const.ts | 2 + packages/lint/src/lib/messages.ts | 9 + packages/lint/src/lib/raw-property-iri.ts | 390 ++++++++++++++++++ packages/lint/src/mod.ts | 3 + packages/lint/src/oxlint.ts | 3 + .../src/rules/raw-property-iri-invalid.ts | 73 ++++ .../tests/raw-property-iri-invalid.test.ts | 321 ++++++++++++++ 12 files changed, 904 insertions(+), 2 deletions(-) create mode 100644 changes.d/lint/raw-property-iri-invalid.md create mode 100644 packages/lint/src/lib/raw-property-iri.ts create mode 100644 packages/lint/src/rules/raw-property-iri-invalid.ts create mode 100644 packages/lint/src/tests/raw-property-iri-invalid.test.ts diff --git a/CHANGES.md b/CHANGES.md index bb28d0593..4f7d34012 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -277,6 +277,15 @@ To be released. plugin rules as errors, so projects generated by `fedify init` exclude the selected rule while keeping the deprecated option usable. [[#1335], [#1340]] + - Added the `raw-property-iri-invalid` rule, which reports property IRIs + passed to `getRawPropertyValues()` and `getRawPropertyValue()` that throw + at runtime, such as terms and JSON-LD keywords, and compact IRIs such as + `as:content`, which are looked up literally. With ESLint and Oxlint, the + `modules` option adds other vocabulary modules generated by + `@fedify/vocab-tools` to the default `@fedify/vocab`. [[#1272], [#1356]] + +[#1272]: https://github.com/fedify-dev/fedify/issues/1272 +[#1356]: https://github.com/fedify-dev/fedify/pull/1356 ### @fedify/postgres @@ -353,9 +362,7 @@ To be released. [#1212]: https://github.com/fedify-dev/fedify/issues/1212 [#1241]: https://github.com/fedify-dev/fedify/pull/1241 [#1243]: https://github.com/fedify-dev/fedify/issues/1243 -[#1272]: https://github.com/fedify-dev/fedify/issues/1272 [#1337]: https://github.com/fedify-dev/fedify/pull/1337 -[#1356]: https://github.com/fedify-dev/fedify/pull/1356 ### @fedify/vocab-runtime diff --git a/changes.d/lint/raw-property-iri-invalid.md b/changes.d/lint/raw-property-iri-invalid.md new file mode 100644 index 000000000..de7081682 --- /dev/null +++ b/changes.d/lint/raw-property-iri-invalid.md @@ -0,0 +1,11 @@ +--- +links: + '#1272': https://github.com/fedify-dev/fedify/issues/1272 + '#1356': https://github.com/fedify-dev/fedify/pull/1356 +--- + - Added the `raw-property-iri-invalid` rule, which reports property IRIs + passed to `getRawPropertyValues()` and `getRawPropertyValue()` that throw + at runtime, such as terms and JSON-LD keywords, and compact IRIs such as + `as:content`, which are looked up literally. With ESLint and Oxlint, the + `modules` option adds other vocabulary modules generated by + `@fedify/vocab-tools` to the default `@fedify/vocab`. [[#1272], [#1356]] diff --git a/docs/manual/lint.md b/docs/manual/lint.md index 149c1573e..382ba624f 100644 --- a/docs/manual/lint.md +++ b/docs/manual/lint.md @@ -1782,6 +1782,80 @@ federation.setFollowersDispatcher( [*Filtering by server*]: ./collections.md#filtering-by-server +### `raw-property-iri-invalid` + +Warns when statically known property IRIs passed to `getRawPropertyValues()` +or `getRawPropertyValue()` are invalid or use a scheme other than +`http:`/`https:`. Named imports, aliases, and namespace imports are +supported; shadowed local bindings are ignored. See [*Reading unsupported +properties*](./vocab.md#reading-unsupported-properties) for these functions. + +Raw-property helpers require full IRIs. Empty strings, JSON-LD keywords, +blank node identifiers, bare terms, relative references, and other invalid +IRI strings throw `TypeError` at runtime. IRIs with other schemes are +accepted at runtime but both log a warning and trigger this rule: compact +IRIs such as `as:content` are looked up literally, and prefixes are never +expanded. For well-known prefixes, the report includes the full IRI, which +ESLint also offers as an editor suggestion. + +~~~~ typescript +import { getRawPropertyValues } from "@fedify/vocab"; + +// Reported: a bare term throws TypeError. +await getRawPropertyValues(note, "content"); + +// Reported: a compact IRI is looked up literally. +await getRawPropertyValues(note, "as:content"); + +// Use the full property IRI. +await getRawPropertyValues(note, "https://www.w3.org/ns/activitystreams#content"); +~~~~ + +The rule checks string literals, templates without expressions, global +`new URL("…")` calls without a base argument, and `const` bindings to those +forms. Dynamic values and `new URL(relative, base)` are ignored. + +By default, only imports from `@fedify/vocab` are inspected, including +`jsr:`/`npm:` and versioned specifiers. The deprecated +`@fedify/fedify/vocab` re-export is also inspected. For other vocabulary +modules generated with `@fedify/vocab-tools`, add their exact import +specifiers to `modules`. +The option adds to the defaults. List each custom specifier form you use, +such as both `@example/vocab` and `npm:@example/vocab`. + +~~~~ typescript +// eslint.config.ts +import { plugin } from "@fedify/lint"; + +export default [{ + plugins: { "@fedify/lint": plugin }, + rules: { + "@fedify/lint/raw-property-iri-invalid": ["warn", { + modules: ["@example/vocab"], + }], + }, +}]; +~~~~ + +Oxlint 1.31.0 or later is required to pass rule options: + +~~~~ jsonc +// .oxlintrc.json +{ + "jsPlugins": ["@fedify/lint/oxlint"], + "rules": { + "@fedify/lint/raw-property-iri-invalid": ["warn", { + "modules": ["@example/vocab"] + }] + } +} +~~~~ + +Deno Lint plugin rules cannot receive options, so this rule inspects only +the default `@fedify/vocab` module specifiers there. Like other Deno Lint +plugin rules, its reports are errors. ESLint's recommended configuration +enables it as a warning; the strict configuration enables it as an error. + ### `deno-kv-store-deprecated` Warns when `DenoKvStore` from the deprecated *@fedify/denokv* package is diff --git a/packages/lint/README.md b/packages/lint/README.md index c139718f7..e90df5933 100644 --- a/packages/lint/README.md +++ b/packages/lint/README.md @@ -21,6 +21,7 @@ The plugin includes rules that check for: - Correct URL patterns for actor collections - Public key and assertion method requirements - Collection filtering implementation + - Full property IRIs for raw-property helpers (`raw-property-iri-invalid`) [JSR badge]: https://jsr.io/badges/@fedify/lint [JSR]: https://jsr.io/@fedify/lint @@ -145,6 +146,11 @@ gateway-compatible IDs. - **`outbox-listener-delivery-not-awaited`**: Warns when an outbox listener calls `sendActivity` or `forwardActivity` and does not wait for the result (ESLint and Oxlint only) + - **`raw-property-iri-invalid`**: Warns when a property IRI passed to + `getRawPropertyValues()` or `getRawPropertyValue()` is not a full + `http:` or `https:` IRI, e.g., a term or a compact IRI like `as:content`; + the `modules` option, available in ESLint and Oxlint only, adds other + generated vocabulary modules to `@fedify/vocab` ### Deprecation rules diff --git a/packages/lint/src/index.ts b/packages/lint/src/index.ts index 82c146ae5..cb4bc3eec 100644 --- a/packages/lint/src/index.ts +++ b/packages/lint/src/index.ts @@ -95,10 +95,13 @@ import { eslint as outboxListenerDeliveryRequired, } from "./rules/outbox-listener-delivery-required.ts"; +import { eslint as rawPropertyIriInvalid } from "./rules/raw-property-iri-invalid.ts"; + const rules: Record< typeof RULE_IDS[keyof typeof RULE_IDS], Rule.RuleModule > = { + [RULE_IDS.rawPropertyIriInvalid]: rawPropertyIriInvalid, [RULE_IDS.actorIdMismatch]: actorIdMismatch, [RULE_IDS.actorIdRequired]: actorIdRequired, [RULE_IDS.actorFollowingPropertyRequired]: actorFollowingPropertyRequired, diff --git a/packages/lint/src/lib/const.ts b/packages/lint/src/lib/const.ts index a077ad105..2fc3d0c27 100644 --- a/packages/lint/src/lib/const.ts +++ b/packages/lint/src/lib/const.ts @@ -185,6 +185,8 @@ export const RULE_IDS = { mediaUploaderObjectUriRequired: "media-uploader-object-uri-required", mediaUploaderAuthorizationRequired: "media-uploader-authorization-required", + rawPropertyIriInvalid: "raw-property-iri-invalid", + // Deprecation rules denoKvStoreDeprecated: "deno-kv-store-deprecated", denoKvMessageQueueDeprecated: "deno-kv-message-queue-deprecated", diff --git a/packages/lint/src/lib/messages.ts b/packages/lint/src/lib/messages.ts index 8d806ab95..dc2c14048 100644 --- a/packages/lint/src/lib/messages.ts +++ b/packages/lint/src/lib/messages.ts @@ -88,3 +88,12 @@ export const DENO_KV_MESSAGE_QUEUE_DEPRECATED = "`PostgresMessageQueue`, `RedisMessageQueue`, `MysqlMessageQueue`, " + "`AmqpMessageQueue`, or `WorkersMessageQueue` for production. See " + "https://github.com/fedify-dev/fedify/issues/1336 for the removal plan."; + +/** Messages for invalid or likely abbreviated raw-property IRIs. */ +export const RAW_PROPERTY_IRI_MESSAGES = { + invalid: + 'Raw property IRI "{{value}}" must be a full, syntactically valid IRI; this value throws TypeError at runtime.', + nonHttp: + 'Raw property IRI "{{value}}" uses a non-HTTP scheme. Prefixes are not expanded.{{hint}}', + expandPrefix: 'Use the full IRI "{{replacement}}".', +}; diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts new file mode 100644 index 000000000..1ec65b923 --- /dev/null +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -0,0 +1,390 @@ +import type { Node } from "./types.ts"; + +/** Options for checking additional generated vocabulary modules. */ +export interface RawPropertyIriOptions { + modules?: readonly string[]; +} + +/** A statically known property IRI and its suggested expansion, if any. */ +export interface RawPropertyIriDiagnostic { + node: Node; + messageId: "invalid" | "nonHttp"; + value: string; + replacement?: string; + suggestionNode?: Node; +} + +// A structural view keeps the analysis independent of the three AST providers. +type Ast = { type: string; [key: string]: unknown }; +interface Binding { + imported?: string; + namespace?: boolean; + init?: Ast; +} +interface Scope { + parent?: Scope; + functionScope: boolean; + bindings: Map; +} + +const functions = new Set([ + "getRawPropertyValues", + "getRawPropertyValue", + "withRawProperty", + "withRawProperties", +]); +const prefixes: Readonly> = { + as: "https://www.w3.org/ns/activitystreams#", + dcterms: "http://purl.org/dc/terms/", + fedibird: "http://fedibird.com/ns#", + ldp: "http://www.w3.org/ns/ldp#", + litepub: "http://litepub.social/ns#", + misskey: "https://misskey-hub.net/ns#", + schema: "http://schema.org#", + sec: "https://w3id.org/security#", + toot: "http://joinmastodon.org/ns#", + vcard: "http://www.w3.org/2006/vcard/ns#", +}; + +function ast(value: unknown): Ast | undefined { + return value != null && typeof value === "object" && + typeof (value as Ast).type === "string" + ? value as Ast + : undefined; +} +function name(value: unknown): string | undefined { + const node = ast(value); + return node?.type === "Identifier" + ? node.name as string + : typeof node?.value === "string" + ? node.value + : undefined; +} +function children(node: Ast): Ast[] { + const result: Ast[] = []; + // Deno exposes AST fields through non-enumerable getters. Include its + // standard child fields explicitly, while retaining parser-specific fields + // from ESTree providers. Never follow parent pointers. + const keys = new Set([ + ...Object.keys(node), + "declaration", + "openingElement", + "closingElement", + "attributes", + "decorators", + "parameter", + "body", + "expression", + "expressions", + "declarations", + "id", + "init", + "params", + "param", + "callee", + "arguments", + "object", + "property", + "key", + "value", + "properties", + "elements", + "left", + "right", + "argument", + "test", + "consequent", + "alternate", + "block", + "handler", + "finalizer", + "cases", + "discriminant", + "update", + "specifiers", + "local", + "imported", + "source", + "superClass", + "tag", + "quasi", + "quasis", + "children", + ]); + for (const key of keys) { + if (key === "parent") continue; + const value = node[key]; + if (Array.isArray(value)) { + for (const item of value) { + const child = ast(item); + if (child) result.push(child); + } + } else { + const child = ast(value); + if (child) result.push(child); + } + } + return result; +} +function bind(pattern: unknown, scope: Scope, binding: Binding = {}): void { + const node = ast(pattern); + if (!node) return; + if (node.type === "Identifier") { + scope.bindings.set(node.name as string, binding); + } else if (node.type === "TSParameterProperty") { + bind(node.parameter, scope); + } else if (node.type === "RestElement") { + bind(node.argument, scope); + } else if (node.type === "AssignmentPattern") { + bind(node.left, scope); + } else if (node.type === "ObjectPattern") { + for (const property of node.properties as Ast[]) { + bind( + property.type === "RestElement" ? property.argument : property.value, + scope, + ); + } + } else if (node.type === "ArrayPattern") { + for (const element of node.elements as unknown[]) bind(element, scope); + } +} +function lookup( + scope: Scope | undefined, + identifier: string, +): Binding | undefined { + for (; scope; scope = scope.parent) { + if (scope.bindings.has(identifier)) return scope.bindings.get(identifier); + } +} + +/** + * Analyze a complete program after collecting lexical bindings, including + * declarations that shadow imports before their textual declaration. + */ +export function checkRawPropertyIris( + program: Node, + options: RawPropertyIriOptions, + report: (diagnostic: RawPropertyIriDiagnostic) => void, +): void { + const scopes = new WeakMap(); + const calls: Ast[] = []; + const root: Scope = { functionScope: true, bindings: new Map() }; + function visit(node: Ast, outer: Scope): void { + const isFunction = + /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/ + .test(node.type); + if ( + node.type === "FunctionDeclaration" || node.type === "ClassDeclaration" + ) { + bind(node.id, outer); + } + const scoped = isFunction || [ + "BlockStatement", + "CatchClause", + "ForStatement", + "ForInStatement", + "ForOfStatement", + "SwitchStatement", + "ClassExpression", + "ClassDeclaration", + "StaticBlock", + ].includes(node.type); + const scope: Scope = scoped + ? { + parent: outer, + functionScope: isFunction || node.type === "StaticBlock", + bindings: new Map(), + } + : outer; + scopes.set(node, scope); + if (isFunction) { + if (node.type === "FunctionExpression") bind(node.id, scope); + for (const param of node.params as unknown[]) bind(param, scope); + } + if (node.type === "ClassExpression" || node.type === "ClassDeclaration") { + bind(node.id, scope); + } + if (node.type === "CatchClause") bind(node.param, scope); + if (node.type === "ImportDeclaration") { + const source = name(node.source); + const included = source != null && ( + /^(?:jsr:|npm:)?@fedify\/vocab(?:@[^/]+)?$/.test(source) || + /^(?:jsr:|npm:)?@fedify\/fedify(?:@[^/]+)?\/vocab$/.test(source) || + options.modules?.includes(source) + ); + for (const specifier of node.specifiers as Ast[]) { + bind( + specifier.local, + scope, + included && node.importKind !== "type" && + specifier.importKind !== "type" + ? { + imported: name(specifier.imported), + namespace: specifier.type === "ImportNamespaceSpecifier", + } + : {}, + ); + } + } + if (node.type === "VariableDeclaration") { + let target = scope; + if (node.kind === "var") { + while (!target.functionScope && target.parent) target = target.parent; + } + for (const declaration of node.declarations as Ast[]) { + bind( + declaration.id, + target, + node.kind === "const" ? { init: ast(declaration.init) } : {}, + ); + } + } + if (node.type === "CallExpression") calls.push(node); + for (const child of children(node)) visit(child, scope); + } + visit(program as unknown as Ast, root); + + function staticString( + node: Ast | undefined, + seen = new Set(), + ): { value: string; literal: Ast } | undefined { + if (!node || seen.has(node)) return; + seen.add(node); + if (node.type === "Literal" && typeof node.value === "string") { + // Deno replaces escaped lone surrogates in Literal.value with U+FFFD. + // JSON-compatible raw literals retain their exact code units. + if (typeof node.raw === "string" && node.raw.startsWith('"')) { + try { + const value: unknown = JSON.parse(node.raw); + if (typeof value === "string") return { value, literal: node }; + } catch { + // JavaScript-only escapes (such as \x20) use the parser's value. + } + } + return { value: node.value, literal: node }; + } + if ( + node.type === "TemplateLiteral" && + (node.expressions as unknown[]).length === 0 + ) { + const quasi = (node.quasis as Ast[])[0]; + const value = (quasi.value as { cooked?: string } | undefined)?.cooked ?? + quasi.cooked; + if (typeof value === "string") return { value, literal: node }; + } + if (node.type === "Identifier") { + return staticString( + lookup(scopes.get(node), node.name as string)?.init, + seen, + ); + } + if ( + node.type === "NewExpression" && name(node.callee) === "URL" && + ast(node.callee)?.type === "Identifier" && + !lookup(scopes.get(node), "URL") + ) { + const args = node.arguments as Ast[]; + if (args.length !== 1) return undefined; + const known = staticString(args[0], seen); + // The raw-property functions see the URL's serialization, which the + // WHATWG URL parser normalizes, e.g., by percent-encoding spaces: + if (known == null || !URL.canParse(known.value)) return known; + return { ...known, value: new URL(known.value).href }; + } + } + function check(node: Ast, key?: string, identifierKey = false): void { + const known = key == null + ? staticString(node) + : { value: key, literal: node }; + if (!known) return; + const value = known.value; + const scheme = /^([A-Za-z][A-Za-z0-9+.-]*):/.exec(value); + const rest = scheme == null ? "" : value.slice(scheme[0].length); + let path = rest; + if (rest.startsWith("//")) { + const end = rest.slice(2).search(/[/?#]/); + path = end < 0 ? "" : rest.slice(2 + end); + } + // These checks follow the raw-property API's IRI syntax contract, rather + // than WHATWG URL parsing (which normalizes spaces and malformed escapes). + if ( + !scheme || rest === "" || value.startsWith("_:") || + path.includes("[") || path.includes("]") || + /["<>\\^`{|}]/u.test(value) || + Array.from(value).some((char) => { + const code = char.codePointAt(0)!; + return code <= 0x20 || (code >= 0x7f && code <= 0x9f) || + (code >= 0xd800 && code <= 0xdfff); + }) || + /%(?![\da-f]{2})/i.test(value) || + value.indexOf("#") !== value.lastIndexOf("#") + ) { + report({ node: node as unknown as Node, messageId: "invalid", value }); + } else if (!/^https?$/i.test(scheme[1])) { + const prefixName = scheme[1].toLowerCase(); + const prefix = Object.hasOwn(prefixes, prefixName) + ? prefixes[prefixName] + : undefined; + const replacement = prefix == null + ? undefined + : prefix + value.slice(scheme[0].length); + report({ + node: node as unknown as Node, + messageId: "nonHttp", + value, + replacement, + // Never suggest changing a const declaration shared by other uses. + suggestionNode: !identifierKey && (known.literal === node || + (node.type === "NewExpression" && + (node.arguments as unknown[])[0] === known.literal)) + ? known.literal as unknown as Node + : undefined, + }); + } + } + for (const call of calls) { + const callee = ast(call.callee); + let functionName: string | undefined; + if (callee?.type === "Identifier") { + functionName = lookup(scopes.get(callee), callee.name as string) + ?.imported; + } else if ( + callee?.type === "MemberExpression" && + ast(callee.object)?.type === "Identifier" + ) { + if (lookup(scopes.get(callee), name(callee.object)!)?.namespace) { + functionName = callee.computed + ? staticString(ast(callee.property))?.value + : name(callee.property); + } + } + if (!functionName || !functions.has(functionName)) continue; + const argument = ast((call.arguments as unknown[])[1]); + if (!argument) continue; + if (functionName !== "withRawProperties") { + check(argument); + } else if (argument.type === "ObjectExpression") { + for (const property of argument.properties as Ast[]) { + if (property.type !== "Property") continue; + const key = ast(property.key); + if (key) { + check( + key, + property.computed ? undefined : name(key) ?? + (key.type === "Literal" && typeof key.value === "number" + ? String(key.value) + : undefined), + !property.computed && key.type === "Identifier", + ); + } + } + } else if (argument.type === "ArrayExpression") { + for (const tuple of argument.elements as unknown[]) { + const pair = ast(tuple); + if (pair?.type !== "ArrayExpression") continue; + const key = ast((pair.elements as unknown[])[0]); + if (key) check(key); + } + } + } +} diff --git a/packages/lint/src/mod.ts b/packages/lint/src/mod.ts index 27a652505..693c667af 100644 --- a/packages/lint/src/mod.ts +++ b/packages/lint/src/mod.ts @@ -86,12 +86,15 @@ import { deno as outboxListenerDeliveryRequired, } from "./rules/outbox-listener-delivery-required.ts"; +import { deno as rawPropertyIriInvalid } from "./rules/raw-property-iri-invalid.ts"; + // `outbox-listener-delivery-not-awaited` is deliberately not registered here: // Deno turns on every rule of a plugin as soon as the plugin is listed, and // gives the rule no way to stay off until a project asks for it. const plugin: Deno.lint.Plugin = { name: "fedify-lint", rules: { + [RULE_IDS.rawPropertyIriInvalid]: rawPropertyIriInvalid, [RULE_IDS.actorIdMismatch]: actorIdMismatch, [RULE_IDS.actorIdRequired]: actorIdRequired, [RULE_IDS.actorFollowingPropertyRequired]: actorFollowingPropertyRequired, diff --git a/packages/lint/src/oxlint.ts b/packages/lint/src/oxlint.ts index 3058c49aa..551e899dd 100644 --- a/packages/lint/src/oxlint.ts +++ b/packages/lint/src/oxlint.ts @@ -106,10 +106,13 @@ import { eslint as outboxListenerDeliveryRequired, } from "./rules/outbox-listener-delivery-required.ts"; +import { eslint as rawPropertyIriInvalid } from "./rules/raw-property-iri-invalid.ts"; + const rules: Record< typeof RULE_IDS[keyof typeof RULE_IDS], Rule.RuleModule > = { + [RULE_IDS.rawPropertyIriInvalid]: rawPropertyIriInvalid, [RULE_IDS.actorIdMismatch]: actorIdMismatch, [RULE_IDS.actorIdRequired]: actorIdRequired, [RULE_IDS.actorFollowingPropertyRequired]: actorFollowingPropertyRequired, diff --git a/packages/lint/src/rules/raw-property-iri-invalid.ts b/packages/lint/src/rules/raw-property-iri-invalid.ts new file mode 100644 index 000000000..3227ba581 --- /dev/null +++ b/packages/lint/src/rules/raw-property-iri-invalid.ts @@ -0,0 +1,73 @@ +import type { Rule } from "eslint"; +import { RAW_PROPERTY_IRI_MESSAGES } from "../lib/messages.ts"; +import { + checkRawPropertyIris, + type RawPropertyIriOptions, +} from "../lib/raw-property-iri.ts"; + +/** Check statically known raw-property IRIs using Deno's default modules. */ +export const deno: Deno.lint.Rule = { + create(context) { + return { + Program(node) { + checkRawPropertyIris(node, { modules: [] }, (diagnostic) => { + const { value, replacement, messageId } = diagnostic; + const hint = replacement ? ` Did you mean "${replacement}"?` : ""; + context.report({ + node: diagnostic.node as Deno.lint.Node, + message: RAW_PROPERTY_IRI_MESSAGES[messageId] + .replace("{{value}}", () => value).replace( + "{{hint}}", + () => hint, + ), + }); + }); + }, + }; + }, +}; + +/** ESLint and Oxlint adapter, with optional generated vocabulary modules. */ +export const eslint: Rule.RuleModule = { + meta: { + type: "problem", + docs: { description: "Check full IRIs passed to raw-property helpers" }, + hasSuggestions: true, + messages: RAW_PROPERTY_IRI_MESSAGES, + schema: [{ + type: "object", + properties: { modules: { type: "array", items: { type: "string" } } }, + additionalProperties: false, + }], + }, + create(context) { + const options: RawPropertyIriOptions = context.options[0] ?? + { modules: [] }; + return { + Program(node) { + checkRawPropertyIris(node, options, (diagnostic) => { + const { value, replacement, messageId, suggestionNode } = diagnostic; + context.report({ + node: diagnostic.node as Rule.Node, + messageId, + data: { + value, + hint: replacement ? ` Did you mean "${replacement}"?` : "", + }, + suggest: replacement && suggestionNode + ? [{ + messageId: "expandPrefix", + data: { replacement }, + fix: (fixer) => + fixer.replaceText( + suggestionNode as Rule.Node, + JSON.stringify(replacement), + ), + }] + : undefined, + }); + }); + }, + }; + }, +}; diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts new file mode 100644 index 000000000..1b5aaff88 --- /dev/null +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -0,0 +1,321 @@ +import assert from "node:assert/strict"; +import { test } from "node:test"; +import { Linter } from "eslint"; +import * as parser from "@typescript-eslint/parser"; +import lintTest from "../lib/test.ts"; +import * as rule from "../rules/raw-property-iri-invalid.ts"; +import { oxlintUnavailable, runOxlint } from "../lib/oxlint.ts"; + +const ruleName = "raw-property-iri-invalid"; +const setup = 'import { getRawPropertyValues as read } from "@fedify/vocab";'; +const cases: [string, string, string?][] = [ + ...[ + "", + "as:", + "https://example/path[0]", + "https://example/\ud800", + "@id", + "_:node", + "content", + "/x", + "#x", + "https://example/x y", + "https://example/%xx", + "https://example/#a#b", + "https://example/\u0001", + 'https://example/"', + "https://example/<", + "https://example/>", + "https://example/\\", + "https://example/^", + "https://example/`", + "https://example/{", + "https://example/|", + "https://example/}", + ].map((value): [string, string, string] => [ + `invalid ${JSON.stringify(value)}`, + `${setup} read(obj, ${JSON.stringify(value)});`, + "must be a full", + ]), + [ + "compact prefix", + `${setup} read(obj, "as:content");`, + 'Did you mean "https://www.w3.org/ns/activitystreams#content"?', + ], + [ + "other scheme", + `${setup} read(obj, "urn:example:property");`, + "non-HTTP scheme", + ], + ["uppercase HTTPS", `${setup} read(obj, "HTTPS://example/prop");`], + ["unicode IRI", `${setup} read(obj, "https://example/이름");`], + ["aliased import", `${setup} read(obj, "content");`, "must be a full"], + [ + "namespace", + 'import * as vocab from "@fedify/vocab"; vocab.getRawPropertyValue(obj, "content");', + "must be a full", + ], + [ + "computed namespace", + 'import * as vocab from "@fedify/vocab"; vocab["withRawProperty"](obj, "content", []);', + "must be a full", + ], + [ + "shadowed function parameter", + `${setup} function f(read) { read(obj, "content"); }`, + ], + [ + "shadowed namespace", + 'import * as vocab from "@fedify/vocab"; function f(vocab) { vocab.getRawPropertyValue(obj, "content"); }', + ], + [ + "hoisted shadow", + `${setup} function f() { read(obj, "content"); var read; }`, + ], + ["block shadow", `${setup} { read(obj, "content"); const read = local; }`], + [ + "destructured parameter", + `${setup} function f({read}) { read(obj, "content"); }`, + ], + ["catch shadow", `${setup} try {} catch (read) { read(obj, "content"); }`], + [ + "loop shadow", + `${setup} for (const read of readers) { read(obj, "content"); }`, + ], + [ + "const", + `${setup} const iri = "content"; read(obj, iri);`, + "must be a full", + ], + [ + "const chain", + `${setup} const iri = "content"; const key = iri; read(obj, key);`, + "must be a full", + ], + [ + "const shadow", + `${setup} const iri = "content"; function f(iri) { read(obj, iri); }`, + ], + ["const cycle", `${setup} const a = b; const b = a; read(obj, a);`], + ["mutable binding ignored", `${setup} let iri = "content"; read(obj, iri);`], + ["template", `${setup} read(obj, \`content\`);`, "must be a full"], + ["dynamic template", `${setup} read(obj, \`https://example/\${key}\`);`], + [ + "URL without base", + `${setup} read(obj, new URL("content"));`, + "must be a full", + ], + ["URL valid", `${setup} read(obj, new URL("https://example/key"));`], + [ + "URL normalized before checking", + `${setup} read(obj, new URL("https://example/a b"));`, + ], + [ + "URL const", + `${setup} const iri = new URL("as:content"); read(obj, iri);`, + "non-HTTP scheme", + ], + [ + "URL with base", + `${setup} read(obj, new URL("content", "https://example/"));`, + ], + [ + "shadowed URL", + `${setup} function f(URL) { read(obj, new URL("content")); }`, + ], + ["dynamic ignored", `${setup} read(obj, getIri());`], + [ + "other module", + 'import { getRawPropertyValue } from "other-vocab"; getRawPropertyValue(obj, "content");', + ], + [ + "type import", + 'import type { getRawPropertyValue } from "@fedify/vocab"; getRawPropertyValue(obj, "content");', + ], + [ + "object keys", + 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, { content: [], "https://example/key": [] });', + "must be a full", + ], + [ + "computed object keys", + 'import { withRawProperties } from "@fedify/vocab"; const iri = "as:content"; withRawProperties(obj, { [iri]: [] });', + "non-HTTP scheme", + ], + [ + "dynamic keys", + 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, { [getIri()]: [], ...other });', + ], + [ + "tuple keys", + 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, [["content", []]]);', + "must be a full", + ], + ...[ + "jsr:@fedify/vocab", + "npm:@fedify/vocab", + "jsr:@fedify/vocab@^2.5.0", + "npm:@fedify/vocab@2.5.0", + "@fedify/fedify/vocab", + "jsr:@fedify/fedify@^2.5.0/vocab", + ].map(( + source, + ): [string, string, string] => [ + source, + `import { withRawProperty } from ${ + JSON.stringify(source) + }; withRawProperty(obj, "content", []);`, + "must be a full", + ]), +]; +cases.push( + [ + "exported function", + `${setup} export function f() { read(obj, "content"); }`, + "must be a full", + ], + [ + "exported shadow", + `${setup} export function f(read) { read(obj, "content"); }`, + ], + [ + "prototype prefix", + `${setup} read(obj, "constructor:property");`, + "non-HTTP scheme", + ], + [ + "numeric object key", + 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, { 123: [] });', + "must be a full", + ], + ["IPv6 authority", `${setup} read(obj, "https://[::1]/property");`], + [ + "escaped template", + `${setup} read(obj, \`con\\u0074ent\`);`, + "must be a full", + ], +); +for (const [label, code, expectedError] of cases) { + test( + `${ruleName}: ${label}`, + lintTest({ rule, ruleName, code, federationSetup: "", expectedError }), + ); +} + +function verify(code: string, options: { modules?: string[] } = {}) { + return new Linter().verify(code, [{ + files: ["**/*.ts"], + languageOptions: { parser }, + plugins: { fedify: { rules: { [ruleName]: rule.eslint } } }, + rules: { [`fedify/${ruleName}`]: ["warn", options] }, + }], "test.ts"); +} + +test("ESLint: modules option includes defaults and accepts frozen options", () => { + const options = Object.freeze({ modules: Object.freeze(["other-vocab"]) }); + // ESLint normalizes configuration before invoking the rule; frozen input + // also guards against accidental mutations of the caller's options. + const code = + 'import { getRawPropertyValue as read } from "other-vocab"; read(obj, "content");'; + assert.equal(verify(code).length, 0); + assert.equal( + verify(code, options as { modules: string[] })[0].messageId, + "invalid", + ); + assert.equal( + verify(`${setup} read(obj, "content");`, options as { modules: string[] }) + .length, + 1, + ); +}); + +test("ESLint: compact prefixes offer suggestions, never autofixes", () => { + const code = `${setup} read(obj, "as:content");`; + const [diagnostic] = verify(code); + assert.equal(diagnostic.messageId, "nonHttp"); + assert.equal(diagnostic.fix, undefined); + assert.equal(diagnostic.suggestions?.length, 1); + const fix = diagnostic.suggestions![0].fix; + const fixed = code.slice(0, fix.range[0]) + fix.text + + code.slice(fix.range[1]); + assert.equal(verify(fixed).length, 0); + assert.equal( + verify(`${setup} const iri = "as:content"; read(obj, iri);`)[0].suggestions, + undefined, + ); +}); + +test("ESLint: template and object-key suggestions produce valid code", () => { + for ( + const code of [ + `${setup} read(obj, \`as:content\`);`, + `${setup} read(obj, new URL("as:content"));`, + 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, { "as:content": [] });', + ] + ) { + const [diagnostic] = verify(code); + const fix = diagnostic.suggestions![0].fix; + assert.equal( + verify(code.slice(0, fix.range[0]) + fix.text + code.slice(fix.range[1])) + .length, + 0, + ); + } +}); + +test( + "Oxlint: default and configured modules", + { skip: oxlintUnavailable }, + () => { + for ( + const [source, options, expected] of [ + ["@fedify/vocab", {}, 1], + ["other-vocab", {}, 0], + ["other-vocab", { modules: ["other-vocab"] }, 1], + ] as const + ) { + const result = runOxlint( + `import { getRawPropertyValue } from ${ + JSON.stringify(source) + }; getRawPropertyValue(obj, "content");`, + { + rules: { [`@fedify/lint/${ruleName}`]: ["warn", options] }, + }, + ); + assert.equal( + result.diagnostics.filter((d) => d.code?.includes(ruleName)).length, + expected, + result.stdout + result.stderr, + ); + } + }, +); + +test("ESLint: every well-known prefix expands to its full IRI", () => { + const prefixes = { + as: "https://www.w3.org/ns/activitystreams#", + dcterms: "http://purl.org/dc/terms/", + fedibird: "http://fedibird.com/ns#", + ldp: "http://www.w3.org/ns/ldp#", + litepub: "http://litepub.social/ns#", + misskey: "https://misskey-hub.net/ns#", + schema: "http://schema.org#", + sec: "https://w3id.org/security#", + toot: "http://joinmastodon.org/ns#", + vcard: "http://www.w3.org/2006/vcard/ns#", + }; + for (const [prefix, namespace] of Object.entries(prefixes)) { + const [diagnostic] = verify(`${setup} read(obj, "${prefix}:property");`); + assert.ok( + diagnostic.message.includes(`Did you mean "${namespace}property"?`), + ); + assert.equal( + diagnostic.suggestions![0].fix.text, + JSON.stringify(namespace + "property"), + ); + } + assert.equal( + verify(`${setup} read(obj, "constructor:property");`)[0].suggestions, + undefined, + ); +}); From 09b671e420a25e8283d406bf2338408dc7fc2147 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 13:43:19 +0900 Subject: [PATCH 04/35] Pair reparsed raw property nodes by id When an accessor reparses an embedded object without its parent's context, some nested values can fail to decode and be dropped. The retained unknown properties were then copied by position, so a remaining id-less attachment could receive the properties of the one that was dropped. Nested objects are still paired by position when the reparse kept every value. Otherwise only objects with the same id are paired, and the rest get no retained properties rather than another object's. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4438633916 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 25 +++++++------ .../src/__snapshots__/class.test.ts.node.snap | 25 +++++++------ .../src/__snapshots__/class.test.ts.snap | 25 +++++++------ packages/vocab-tools/src/raw-property.ts | 25 +++++++------ packages/vocab/src/raw-property.test.ts | 37 +++++++++++++++++++ 5 files changed, 89 insertions(+), 48 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 2e6e7de68..a3f5beb1f 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -438,7 +438,9 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position: +// pairing nested objects by property and position. When the decoding dropped +// some values of a property, positions no longer correspond, so only objects +// with the same id are paired: function copyRawPropertiesDeep( source: object, destination: object, @@ -459,17 +461,16 @@ function copyRawPropertiesDeep( for (const descriptor of descriptors) { const sources = descriptor.values(source); const destinations = descriptor.values(destination); - const length = globalThis.Math.min(sources.length, destinations.length); - for (let i = 0; i < length; i++) { - if ( - sources[i] !== destinations[i] && - isSameRawPropertyNode(sources[i], destinations[i]) - ) { - copyRawPropertiesDeep( - sources[i] as object, - destinations[i] as object, - visited, - ); + const aligned = sources.length === destinations.length; + for (let i = 0; i < destinations.length; i++) { + const destination = destinations[i]; + const source = aligned + ? sources[i] + : (destination as { id?: URL | null } | null)?.id == null + ? undefined + : sources.find((s) => isSameRawPropertyNode(s, destination)); + if (source !== destination && isSameRawPropertyNode(source, destination)) { + copyRawPropertiesDeep(source as object, destination as object, visited); } } } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index d50bdec1d..76fd9c6a7 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -436,7 +436,9 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position: +// pairing nested objects by property and position. When the decoding dropped +// some values of a property, positions no longer correspond, so only objects +// with the same id are paired: function copyRawPropertiesDeep( source: object, destination: object, @@ -457,17 +459,16 @@ function copyRawPropertiesDeep( for (const descriptor of descriptors) { const sources = descriptor.values(source); const destinations = descriptor.values(destination); - const length = globalThis.Math.min(sources.length, destinations.length); - for (let i = 0; i < length; i++) { - if ( - sources[i] !== destinations[i] && - isSameRawPropertyNode(sources[i], destinations[i]) - ) { - copyRawPropertiesDeep( - sources[i] as object, - destinations[i] as object, - visited, - ); + const aligned = sources.length === destinations.length; + for (let i = 0; i < destinations.length; i++) { + const destination = destinations[i]; + const source = aligned + ? sources[i] + : (destination as { id?: URL | null } | null)?.id == null + ? undefined + : sources.find((s) => isSameRawPropertyNode(s, destination)); + if (source !== destination && isSameRawPropertyNode(source, destination)) { + copyRawPropertiesDeep(source as object, destination as object, visited); } } } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 41f0ac782..30146b1a6 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -438,7 +438,9 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position: +// pairing nested objects by property and position. When the decoding dropped +// some values of a property, positions no longer correspond, so only objects +// with the same id are paired: function copyRawPropertiesDeep( source: object, destination: object, @@ -459,17 +461,16 @@ function copyRawPropertiesDeep( for (const descriptor of descriptors) { const sources = descriptor.values(source); const destinations = descriptor.values(destination); - const length = globalThis.Math.min(sources.length, destinations.length); - for (let i = 0; i < length; i++) { - if ( - sources[i] !== destinations[i] && - isSameRawPropertyNode(sources[i], destinations[i]) - ) { - copyRawPropertiesDeep( - sources[i] as object, - destinations[i] as object, - visited, - ); + const aligned = sources.length === destinations.length; + for (let i = 0; i < destinations.length; i++) { + const destination = destinations[i]; + const source = aligned + ? sources[i] + : (destination as { id?: URL | null } | null)?.id == null + ? undefined + : sources.find((s) => isSameRawPropertyNode(s, destination)); + if (source !== destination && isSameRawPropertyNode(source, destination)) { + copyRawPropertiesDeep(source as object, destination as object, visited); } } } diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index bfdcacbb5..62ccb0d04 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -115,7 +115,9 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position: +// pairing nested objects by property and position. When the decoding dropped +// some values of a property, positions no longer correspond, so only objects +// with the same id are paired: function copyRawPropertiesDeep( source: object, destination: object, @@ -136,17 +138,16 @@ function copyRawPropertiesDeep( for (const descriptor of descriptors) { const sources = descriptor.values(source); const destinations = descriptor.values(destination); - const length = globalThis.Math.min(sources.length, destinations.length); - for (let i = 0; i < length; i++) { - if ( - sources[i] !== destinations[i] && - isSameRawPropertyNode(sources[i], destinations[i]) - ) { - copyRawPropertiesDeep( - sources[i] as object, - destinations[i] as object, - visited, - ); + const aligned = sources.length === destinations.length; + for (let i = 0; i < destinations.length; i++) { + const destination = destinations[i]; + const source = aligned + ? sources[i] + : (destination as { id?: URL | null } | null)?.id == null + ? undefined + : sources.find((s) => isSameRawPropertyNode(s, destination)); + if (source !== destination && isSameRawPropertyNode(source, destination)) { + copyRawPropertiesDeep(source as object, destination as object, visited); } } } diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index ff40b1e56..fc50ae8da 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -173,6 +173,43 @@ test("getRawPropertyValues() reads objects nested in reparsed embedded objects", ]); }); +test("getRawPropertyValues() does not mix up objects dropped by a reparse", async () => { + const create = await Create.fromJsonLd({ + "@context": [AS, { quant: QUANT, Doc: `${AS}#Document` }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": AS, + id: "https://example.com/notes/1", + type: "Note", + attachment: [ + { + // Only the outer context defines this type alias: + type: "Doc", + "quant:structuredUrl": { "@id": "https://example.com/data/a" }, + }, + { + type: "Document", + "quant:structuredUrl": { "@id": "https://example.com/data/b" }, + }, + ], + }, + }); + const note = await create.getObject(); + ok(note instanceof Note); + const attachments = await Array.fromAsync(note.getAttachments()); + // Reparsed without the outer context, the first attachment is dropped: + strictEqual(attachments.length, 1); + ok(attachments[0] != null); + // Without an id to match, the remaining attachment cannot be paired with + // its original, so it must not receive the dropped attachment's values: + deepStrictEqual( + await getRawPropertyValues(attachments[0], STRUCTURED_URL), + [], + ); +}); + test("getRawPropertyValues() keeps unknown properties across copies", async () => { const note = await Note.fromJsonLd(structuredNote); const expected = [{ "@id": "https://example.com/data/1?token=abc" }]; From f41f97ab2ecff0c52409bc35dd5da7ff681317d1 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 13:44:26 +0900 Subject: [PATCH 05/35] Skip tokens and comments in lint IRI traversal ESLint and typescript-eslint attach enumerable tokens and comments arrays to the Program node. Their elements have a string type, so the raw-property-iri-invalid rule walked every token and comment as if it were an AST node. Skipping them changes no results. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4438604758 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 1ec65b923..92c018916 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -112,7 +112,8 @@ function children(node: Ast): Ast[] { "children", ]); for (const key of keys) { - if (key === "parent") continue; + // ESTree providers attach the token and comment arrays to Program: + if (key === "parent" || key === "tokens" || key === "comments") continue; const value = node[key]; if (Array.isArray(value)) { for (const item of value) { From 037b5251f8793897150e6d93dc5ea4876add0ebb Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 13:44:41 +0900 Subject: [PATCH 06/35] Check only the read functions in the IRI lint rule The raw-property-iri-invalid rule also matched withRawProperty() and withRawProperties(), and assumed an argument shape for the latter, although neither function exists yet. If the final API differs, the rule would report the wrong arguments or miss real ones. The write functions and their argument handling belong in the change that adds them; see https://github.com/fedify-dev/fedify/issues/1355. https://github.com/fedify-dev/fedify/pull/1356#pullrequestreview-5731727772 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 39 +++---------------- .../tests/raw-property-iri-invalid.test.ts | 33 ++-------------- 2 files changed, 9 insertions(+), 63 deletions(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 92c018916..48ff33ff0 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -30,8 +30,6 @@ interface Scope { const functions = new Set([ "getRawPropertyValues", "getRawPropertyValue", - "withRawProperty", - "withRawProperties", ]); const prefixes: Readonly> = { as: "https://www.w3.org/ns/activitystreams#", @@ -293,10 +291,8 @@ export function checkRawPropertyIris( return { ...known, value: new URL(known.value).href }; } } - function check(node: Ast, key?: string, identifierKey = false): void { - const known = key == null - ? staticString(node) - : { value: key, literal: node }; + function check(node: Ast): void { + const known = staticString(node); if (!known) return; const value = known.value; const scheme = /^([A-Za-z][A-Za-z0-9+.-]*):/.exec(value); @@ -335,9 +331,9 @@ export function checkRawPropertyIris( value, replacement, // Never suggest changing a const declaration shared by other uses. - suggestionNode: !identifierKey && (known.literal === node || + suggestionNode: known.literal === node || (node.type === "NewExpression" && - (node.arguments as unknown[])[0] === known.literal)) + (node.arguments as unknown[])[0] === known.literal) ? known.literal as unknown as Node : undefined, }); @@ -361,31 +357,6 @@ export function checkRawPropertyIris( } if (!functionName || !functions.has(functionName)) continue; const argument = ast((call.arguments as unknown[])[1]); - if (!argument) continue; - if (functionName !== "withRawProperties") { - check(argument); - } else if (argument.type === "ObjectExpression") { - for (const property of argument.properties as Ast[]) { - if (property.type !== "Property") continue; - const key = ast(property.key); - if (key) { - check( - key, - property.computed ? undefined : name(key) ?? - (key.type === "Literal" && typeof key.value === "number" - ? String(key.value) - : undefined), - !property.computed && key.type === "Identifier", - ); - } - } - } else if (argument.type === "ArrayExpression") { - for (const tuple of argument.elements as unknown[]) { - const pair = ast(tuple); - if (pair?.type !== "ArrayExpression") continue; - const key = ast((pair.elements as unknown[])[0]); - if (key) check(key); - } - } + if (argument) check(argument); } } diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index 1b5aaff88..087018ec8 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -57,7 +57,7 @@ const cases: [string, string, string?][] = [ ], [ "computed namespace", - 'import * as vocab from "@fedify/vocab"; vocab["withRawProperty"](obj, "content", []);', + 'import * as vocab from "@fedify/vocab"; vocab["getRawPropertyValue"](obj, "content");', "must be a full", ], [ @@ -132,25 +132,6 @@ const cases: [string, string, string?][] = [ "type import", 'import type { getRawPropertyValue } from "@fedify/vocab"; getRawPropertyValue(obj, "content");', ], - [ - "object keys", - 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, { content: [], "https://example/key": [] });', - "must be a full", - ], - [ - "computed object keys", - 'import { withRawProperties } from "@fedify/vocab"; const iri = "as:content"; withRawProperties(obj, { [iri]: [] });', - "non-HTTP scheme", - ], - [ - "dynamic keys", - 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, { [getIri()]: [], ...other });', - ], - [ - "tuple keys", - 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, [["content", []]]);', - "must be a full", - ], ...[ "jsr:@fedify/vocab", "npm:@fedify/vocab", @@ -162,9 +143,9 @@ const cases: [string, string, string?][] = [ source, ): [string, string, string] => [ source, - `import { withRawProperty } from ${ + `import { getRawPropertyValue } from ${ JSON.stringify(source) - }; withRawProperty(obj, "content", []);`, + }; getRawPropertyValue(obj, "content");`, "must be a full", ]), ]; @@ -183,11 +164,6 @@ cases.push( `${setup} read(obj, "constructor:property");`, "non-HTTP scheme", ], - [ - "numeric object key", - 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, { 123: [] });', - "must be a full", - ], ["IPv6 authority", `${setup} read(obj, "https://[::1]/property");`], [ "escaped template", @@ -245,12 +221,11 @@ test("ESLint: compact prefixes offer suggestions, never autofixes", () => { ); }); -test("ESLint: template and object-key suggestions produce valid code", () => { +test("ESLint: template and URL suggestions produce valid code", () => { for ( const code of [ `${setup} read(obj, \`as:content\`);`, `${setup} read(obj, new URL("as:content"));`, - 'import { withRawProperties } from "@fedify/vocab"; withRawProperties(obj, { "as:content": [] });', ] ) { const [diagnostic] = verify(code); From 7d750aa3eab45a39216fda1f50cf989ef2e32f8f Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 16:53:49 +0900 Subject: [PATCH 07/35] Keep raw properties when a reparse changes class An outer-only type alias can make the cached reparse of an embedded object pick a different class than the original decode, for example Object instead of Question. The reparsed object then retains properties such as oneOf that the original class knew, but copying the original's retention over it deleted them, so getRawPropertyValues() returned nothing for a property present in the input. Retention is now copied only between objects of the same class and id, at the root as well as for nested objects. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4439061095 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 11 +++++---- .../src/__snapshots__/class.test.ts.node.snap | 11 +++++---- .../src/__snapshots__/class.test.ts.snap | 11 +++++---- packages/vocab-tools/src/raw-property.ts | 11 +++++---- packages/vocab/src/raw-property.test.ts | 23 +++++++++++++++++++ 5 files changed, 51 insertions(+), 16 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index a3f5beb1f..7d657e76d 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -438,9 +438,10 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. When the decoding dropped -// some values of a property, positions no longer correspond, so only objects -// with the same id are paired: +// pairing nested objects by property and position. Only objects of the same +// class and id are paired. When the decoding dropped some values of +// a property, positions no longer correspond, so nested objects are paired +// by id alone: function copyRawPropertiesDeep( source: object, destination: object, @@ -448,8 +449,10 @@ function copyRawPropertiesDeep( ): void { if (visited.has(destination)) return; visited.add(destination); - copyRawProperties(source, destination); + // A different class classifies properties differently, so the retention + // of the copy, decoded again by that class, is the one to keep: if (!isSameRawPropertyNode(source, destination)) return; + copyRawProperties(source, destination); const descriptors = new Set(); let prototype: object | null = globalThis.Object.getPrototypeOf(destination); while (prototype != null) { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 76fd9c6a7..4778c8e94 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -436,9 +436,10 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. When the decoding dropped -// some values of a property, positions no longer correspond, so only objects -// with the same id are paired: +// pairing nested objects by property and position. Only objects of the same +// class and id are paired. When the decoding dropped some values of +// a property, positions no longer correspond, so nested objects are paired +// by id alone: function copyRawPropertiesDeep( source: object, destination: object, @@ -446,8 +447,10 @@ function copyRawPropertiesDeep( ): void { if (visited.has(destination)) return; visited.add(destination); - copyRawProperties(source, destination); + // A different class classifies properties differently, so the retention + // of the copy, decoded again by that class, is the one to keep: if (!isSameRawPropertyNode(source, destination)) return; + copyRawProperties(source, destination); const descriptors = new Set(); let prototype: object | null = globalThis.Object.getPrototypeOf(destination); while (prototype != null) { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 30146b1a6..aaadd7a9b 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -438,9 +438,10 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. When the decoding dropped -// some values of a property, positions no longer correspond, so only objects -// with the same id are paired: +// pairing nested objects by property and position. Only objects of the same +// class and id are paired. When the decoding dropped some values of +// a property, positions no longer correspond, so nested objects are paired +// by id alone: function copyRawPropertiesDeep( source: object, destination: object, @@ -448,8 +449,10 @@ function copyRawPropertiesDeep( ): void { if (visited.has(destination)) return; visited.add(destination); - copyRawProperties(source, destination); + // A different class classifies properties differently, so the retention + // of the copy, decoded again by that class, is the one to keep: if (!isSameRawPropertyNode(source, destination)) return; + copyRawProperties(source, destination); const descriptors = new Set(); let prototype: object | null = globalThis.Object.getPrototypeOf(destination); while (prototype != null) { diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index 62ccb0d04..f4e8e427a 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -115,9 +115,10 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. When the decoding dropped -// some values of a property, positions no longer correspond, so only objects -// with the same id are paired: +// pairing nested objects by property and position. Only objects of the same +// class and id are paired. When the decoding dropped some values of +// a property, positions no longer correspond, so nested objects are paired +// by id alone: function copyRawPropertiesDeep( source: object, destination: object, @@ -125,8 +126,10 @@ function copyRawPropertiesDeep( ): void { if (visited.has(destination)) return; visited.add(destination); - copyRawProperties(source, destination); + // A different class classifies properties differently, so the retention + // of the copy, decoded again by that class, is the one to keep: if (!isSameRawPropertyNode(source, destination)) return; + copyRawProperties(source, destination); const descriptors = new Set(); let prototype: object | null = globalThis.Object.getPrototypeOf(destination); while (prototype != null) { diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index fc50ae8da..ae8ac74de 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -210,6 +210,29 @@ test("getRawPropertyValues() does not mix up objects dropped by a reparse", asyn ); }); +test("getRawPropertyValues() keeps unknown properties when a reparse changes the class", async () => { + const create = await Create.fromJsonLd({ + "@context": [AS, { Poll: `${AS}#Question` }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": AS, + id: "https://example.com/questions/1", + // Only the outer context defines this type alias: + type: ["Poll", "Object"], + oneOf: [{ type: "Note", name: "Yes" }], + }, + }); + const object = await create.getObject(); + ok(object != null); + ok(!(object instanceof Question)); + deepStrictEqual( + (await getRawPropertyValues(object, `${AS}#oneOf`)).length, + 1, + ); +}); + test("getRawPropertyValues() keeps unknown properties across copies", async () => { const note = await Note.fromJsonLd(structuredNote); const expected = [{ "@id": "https://example.com/data/1?token=abc" }]; From 88dc2920ec9ac5fb8ab9ad276cbbddfdf744a9de Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 17:38:36 +0900 Subject: [PATCH 08/35] Merge raw properties across a class change The previous fix kept the reparsed object's own retention when the reparse picked a different class, but dropped the original's. A property expanded with a prefix that only the parent's context defined, such as quant:structuredUrl, then disappeared, and objects nested in the reparsed object were not visited at all. When the classes differ, the original's retained values are now merged into the copy's for the properties the copy's class does not know either, and nested objects are followed through the properties both classes declare. Objects of the same class still take the original's retention as is. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4440050830 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 71 ++++++++++++++----- .../src/__snapshots__/class.test.ts.node.snap | 71 ++++++++++++++----- .../src/__snapshots__/class.test.ts.snap | 71 ++++++++++++++----- packages/vocab-tools/src/raw-property.ts | 71 ++++++++++++++----- packages/vocab/src/raw-property.test.ts | 19 ++++- 5 files changed, 229 insertions(+), 74 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 7d657e76d..cd45b349a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -425,9 +425,7 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { if ( source == null || destination == null || typeof source !== \\"object\\" || typeof destination !== \\"object\\" || - !(RAW_PROPERTY_PROTOCOL in source) || - globalThis.Object.getPrototypeOf(source) !== - globalThis.Object.getPrototypeOf(destination) + !(RAW_PROPERTY_PROTOCOL in source) || !(RAW_PROPERTY_PROTOCOL in destination) ) { return false; } @@ -436,12 +434,50 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { return sourceId?.href === destinationId?.href; } +function getRawPropertyDescriptors(object: object): Set { + const descriptors = new Set(); + let prototype: object | null = globalThis.Object.getPrototypeOf(object); + while (prototype != null) { + for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { + descriptors.add(descriptor); + } + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return descriptors; +} + +// Merges the retained unknown properties of a decoded object into a copy that +// was decoded again by a different class. The classes classify properties +// differently, so the copy keeps what it retained itself and gains the +// original's values for the properties its own class does not know either: +function mergeRawProperties(source: object, destination: object): void { + const retained = retainedRawProperties.get(source); + if (retained == null) return; + const merged: Record = { + ...retainedRawProperties.get(destination), + }; + let changed = false; + for (const [iri, values] of globalThis.Object.entries(retained)) { + if (getRawPropertyDescriptor(destination, iri) != null) continue; + merged[iri] = values; + changed = true; + } + if (changed) { + retainedRawProperties.set( + destination, + globalThis.Object.freeze(merged) as RetainedRawProperties, + ); + } +} + // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. Only objects of the same -// class and id are paired. When the decoding dropped some values of -// a property, positions no longer correspond, so nested objects are paired -// by id alone: +// pairing nested objects by property and position. Only objects with the same +// id are paired. When the decoding dropped some values of a property, +// positions no longer correspond, so nested objects are paired by id alone. +// When the copy was decoded by a different class, the retained properties are +// merged rather than replaced, and only the properties both classes declare +// are followed: function copyRawPropertiesDeep( source: object, destination: object, @@ -449,19 +485,18 @@ function copyRawPropertiesDeep( ): void { if (visited.has(destination)) return; visited.add(destination); - // A different class classifies properties differently, so the retention - // of the copy, decoded again by that class, is the one to keep: if (!isSameRawPropertyNode(source, destination)) return; - copyRawProperties(source, destination); - const descriptors = new Set(); - let prototype: object | null = globalThis.Object.getPrototypeOf(destination); - while (prototype != null) { - for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { - descriptors.add(descriptor); + const sameClass = globalThis.Object.getPrototypeOf(source) === + globalThis.Object.getPrototypeOf(destination); + if (sameClass) copyRawProperties(source, destination); + else mergeRawProperties(source, destination); + const sourceDescriptors = sameClass + ? undefined + : getRawPropertyDescriptors(source); + for (const descriptor of getRawPropertyDescriptors(destination)) { + if (sourceDescriptors != null && !sourceDescriptors.has(descriptor)) { + continue; } - prototype = globalThis.Object.getPrototypeOf(prototype); - } - for (const descriptor of descriptors) { const sources = descriptor.values(source); const destinations = descriptor.values(destination); const aligned = sources.length === destinations.length; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 4778c8e94..1bccad605 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -423,9 +423,7 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { if ( source == null || destination == null || typeof source !== \\"object\\" || typeof destination !== \\"object\\" || - !(RAW_PROPERTY_PROTOCOL in source) || - globalThis.Object.getPrototypeOf(source) !== - globalThis.Object.getPrototypeOf(destination) + !(RAW_PROPERTY_PROTOCOL in source) || !(RAW_PROPERTY_PROTOCOL in destination) ) { return false; } @@ -434,12 +432,50 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { return sourceId?.href === destinationId?.href; } +function getRawPropertyDescriptors(object: object): Set { + const descriptors = new Set(); + let prototype: object | null = globalThis.Object.getPrototypeOf(object); + while (prototype != null) { + for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { + descriptors.add(descriptor); + } + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return descriptors; +} + +// Merges the retained unknown properties of a decoded object into a copy that +// was decoded again by a different class. The classes classify properties +// differently, so the copy keeps what it retained itself and gains the +// original's values for the properties its own class does not know either: +function mergeRawProperties(source: object, destination: object): void { + const retained = retainedRawProperties.get(source); + if (retained == null) return; + const merged: Record = { + ...retainedRawProperties.get(destination), + }; + let changed = false; + for (const [iri, values] of globalThis.Object.entries(retained)) { + if (getRawPropertyDescriptor(destination, iri) != null) continue; + merged[iri] = values; + changed = true; + } + if (changed) { + retainedRawProperties.set( + destination, + globalThis.Object.freeze(merged) as RetainedRawProperties, + ); + } +} + // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. Only objects of the same -// class and id are paired. When the decoding dropped some values of -// a property, positions no longer correspond, so nested objects are paired -// by id alone: +// pairing nested objects by property and position. Only objects with the same +// id are paired. When the decoding dropped some values of a property, +// positions no longer correspond, so nested objects are paired by id alone. +// When the copy was decoded by a different class, the retained properties are +// merged rather than replaced, and only the properties both classes declare +// are followed: function copyRawPropertiesDeep( source: object, destination: object, @@ -447,19 +483,18 @@ function copyRawPropertiesDeep( ): void { if (visited.has(destination)) return; visited.add(destination); - // A different class classifies properties differently, so the retention - // of the copy, decoded again by that class, is the one to keep: if (!isSameRawPropertyNode(source, destination)) return; - copyRawProperties(source, destination); - const descriptors = new Set(); - let prototype: object | null = globalThis.Object.getPrototypeOf(destination); - while (prototype != null) { - for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { - descriptors.add(descriptor); + const sameClass = globalThis.Object.getPrototypeOf(source) === + globalThis.Object.getPrototypeOf(destination); + if (sameClass) copyRawProperties(source, destination); + else mergeRawProperties(source, destination); + const sourceDescriptors = sameClass + ? undefined + : getRawPropertyDescriptors(source); + for (const descriptor of getRawPropertyDescriptors(destination)) { + if (sourceDescriptors != null && !sourceDescriptors.has(descriptor)) { + continue; } - prototype = globalThis.Object.getPrototypeOf(prototype); - } - for (const descriptor of descriptors) { const sources = descriptor.values(source); const destinations = descriptor.values(destination); const aligned = sources.length === destinations.length; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index aaadd7a9b..9727b172d 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -425,9 +425,7 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { if ( source == null || destination == null || typeof source !== "object" || typeof destination !== "object" || - !(RAW_PROPERTY_PROTOCOL in source) || - globalThis.Object.getPrototypeOf(source) !== - globalThis.Object.getPrototypeOf(destination) + !(RAW_PROPERTY_PROTOCOL in source) || !(RAW_PROPERTY_PROTOCOL in destination) ) { return false; } @@ -436,12 +434,50 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { return sourceId?.href === destinationId?.href; } +function getRawPropertyDescriptors(object: object): Set { + const descriptors = new Set(); + let prototype: object | null = globalThis.Object.getPrototypeOf(object); + while (prototype != null) { + for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { + descriptors.add(descriptor); + } + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return descriptors; +} + +// Merges the retained unknown properties of a decoded object into a copy that +// was decoded again by a different class. The classes classify properties +// differently, so the copy keeps what it retained itself and gains the +// original's values for the properties its own class does not know either: +function mergeRawProperties(source: object, destination: object): void { + const retained = retainedRawProperties.get(source); + if (retained == null) return; + const merged: Record = { + ...retainedRawProperties.get(destination), + }; + let changed = false; + for (const [iri, values] of globalThis.Object.entries(retained)) { + if (getRawPropertyDescriptor(destination, iri) != null) continue; + merged[iri] = values; + changed = true; + } + if (changed) { + retainedRawProperties.set( + destination, + globalThis.Object.freeze(merged) as RetainedRawProperties, + ); + } +} + // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. Only objects of the same -// class and id are paired. When the decoding dropped some values of -// a property, positions no longer correspond, so nested objects are paired -// by id alone: +// pairing nested objects by property and position. Only objects with the same +// id are paired. When the decoding dropped some values of a property, +// positions no longer correspond, so nested objects are paired by id alone. +// When the copy was decoded by a different class, the retained properties are +// merged rather than replaced, and only the properties both classes declare +// are followed: function copyRawPropertiesDeep( source: object, destination: object, @@ -449,19 +485,18 @@ function copyRawPropertiesDeep( ): void { if (visited.has(destination)) return; visited.add(destination); - // A different class classifies properties differently, so the retention - // of the copy, decoded again by that class, is the one to keep: if (!isSameRawPropertyNode(source, destination)) return; - copyRawProperties(source, destination); - const descriptors = new Set(); - let prototype: object | null = globalThis.Object.getPrototypeOf(destination); - while (prototype != null) { - for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { - descriptors.add(descriptor); + const sameClass = globalThis.Object.getPrototypeOf(source) === + globalThis.Object.getPrototypeOf(destination); + if (sameClass) copyRawProperties(source, destination); + else mergeRawProperties(source, destination); + const sourceDescriptors = sameClass + ? undefined + : getRawPropertyDescriptors(source); + for (const descriptor of getRawPropertyDescriptors(destination)) { + if (sourceDescriptors != null && !sourceDescriptors.has(descriptor)) { + continue; } - prototype = globalThis.Object.getPrototypeOf(prototype); - } - for (const descriptor of descriptors) { const sources = descriptor.values(source); const destinations = descriptor.values(destination); const aligned = sources.length === destinations.length; diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index f4e8e427a..ada3842fb 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -102,9 +102,7 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { if ( source == null || destination == null || typeof source !== "object" || typeof destination !== "object" || - !(RAW_PROPERTY_PROTOCOL in source) || - globalThis.Object.getPrototypeOf(source) !== - globalThis.Object.getPrototypeOf(destination) + !(RAW_PROPERTY_PROTOCOL in source) || !(RAW_PROPERTY_PROTOCOL in destination) ) { return false; } @@ -113,12 +111,50 @@ function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { return sourceId?.href === destinationId?.href; } +function getRawPropertyDescriptors(object: object): Set { + const descriptors = new Set(); + let prototype: object | null = globalThis.Object.getPrototypeOf(object); + while (prototype != null) { + for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { + descriptors.add(descriptor); + } + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return descriptors; +} + +// Merges the retained unknown properties of a decoded object into a copy that +// was decoded again by a different class. The classes classify properties +// differently, so the copy keeps what it retained itself and gains the +// original's values for the properties its own class does not know either: +function mergeRawProperties(source: object, destination: object): void { + const retained = retainedRawProperties.get(source); + if (retained == null) return; + const merged: Record = { + ...retainedRawProperties.get(destination), + }; + let changed = false; + for (const [iri, values] of globalThis.Object.entries(retained)) { + if (getRawPropertyDescriptor(destination, iri) != null) continue; + merged[iri] = values; + changed = true; + } + if (changed) { + retainedRawProperties.set( + destination, + globalThis.Object.freeze(merged) as RetainedRawProperties, + ); + } +} + // Copies the retained unknown properties of a decoded object and of the // objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. Only objects of the same -// class and id are paired. When the decoding dropped some values of -// a property, positions no longer correspond, so nested objects are paired -// by id alone: +// pairing nested objects by property and position. Only objects with the same +// id are paired. When the decoding dropped some values of a property, +// positions no longer correspond, so nested objects are paired by id alone. +// When the copy was decoded by a different class, the retained properties are +// merged rather than replaced, and only the properties both classes declare +// are followed: function copyRawPropertiesDeep( source: object, destination: object, @@ -126,19 +162,18 @@ function copyRawPropertiesDeep( ): void { if (visited.has(destination)) return; visited.add(destination); - // A different class classifies properties differently, so the retention - // of the copy, decoded again by that class, is the one to keep: if (!isSameRawPropertyNode(source, destination)) return; - copyRawProperties(source, destination); - const descriptors = new Set(); - let prototype: object | null = globalThis.Object.getPrototypeOf(destination); - while (prototype != null) { - for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { - descriptors.add(descriptor); + const sameClass = globalThis.Object.getPrototypeOf(source) === + globalThis.Object.getPrototypeOf(destination); + if (sameClass) copyRawProperties(source, destination); + else mergeRawProperties(source, destination); + const sourceDescriptors = sameClass + ? undefined + : getRawPropertyDescriptors(source); + for (const descriptor of getRawPropertyDescriptors(destination)) { + if (sourceDescriptors != null && !sourceDescriptors.has(descriptor)) { + continue; } - prototype = globalThis.Object.getPrototypeOf(prototype); - } - for (const descriptor of descriptors) { const sources = descriptor.values(source); const destinations = descriptor.values(destination); const aligned = sources.length === destinations.length; diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index ae8ac74de..287f1bee4 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -212,25 +212,40 @@ test("getRawPropertyValues() does not mix up objects dropped by a reparse", asyn test("getRawPropertyValues() keeps unknown properties when a reparse changes the class", async () => { const create = await Create.fromJsonLd({ - "@context": [AS, { Poll: `${AS}#Question` }], + "@context": [AS, { Poll: `${AS}#Question`, quant: QUANT }], id: "https://example.com/activities/1", type: "Create", actor: "https://example.com/users/alice", object: { "@context": AS, id: "https://example.com/questions/1", - // Only the outer context defines this type alias: + // Only the outer context defines this type alias and prefix: type: ["Poll", "Object"], oneOf: [{ type: "Note", name: "Yes" }], + "quant:structuredUrl": { "@id": "https://example.com/data/1" }, + attachment: { + type: "Document", + "quant:structuredUrl": { "@id": "https://example.com/data/2" }, + }, }, }); const object = await create.getObject(); ok(object != null); ok(!(object instanceof Question)); + // Retained only by the reparse, as the original class knew it: deepStrictEqual( (await getRawPropertyValues(object, `${AS}#oneOf`)).length, 1, ); + // Retained only by the original decode, which had the outer context: + deepStrictEqual(await getRawPropertyValues(object, STRUCTURED_URL), [ + { "@id": "https://example.com/data/1" }, + ]); + const [attachment] = await Array.fromAsync(object.getAttachments()); + ok(attachment != null); + deepStrictEqual(await getRawPropertyValues(attachment, STRUCTURED_URL), [ + { "@id": "https://example.com/data/2" }, + ]); }); test("getRawPropertyValues() keeps unknown properties across copies", async () => { From 35b058bf6ef1e8ed56ba2384de721bfc5b727bdc Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 18:11:36 +0900 Subject: [PATCH 09/35] Ignore URL objects bound to const in IRI lint The raw-property-iri-invalid rule resolved a const binding to a new URL("...") expression from its initializer. A URL object is mutable, so code that changes it before the call, for example through its href setter, was reported for an IRI that the runtime never receives. Only a URL constructed in place is now checked; const bindings to strings are still followed. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4440486780 Assisted-by: Claude Code:claude-opus-5-5 --- docs/manual/lint.md | 8 +++++--- packages/lint/src/lib/raw-property-iri.ts | 5 +++++ packages/lint/src/tests/raw-property-iri-invalid.test.ts | 5 ++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/manual/lint.md b/docs/manual/lint.md index 382ba624f..9e63f1082 100644 --- a/docs/manual/lint.md +++ b/docs/manual/lint.md @@ -1811,9 +1811,11 @@ await getRawPropertyValues(note, "as:content"); await getRawPropertyValues(note, "https://www.w3.org/ns/activitystreams#content"); ~~~~ -The rule checks string literals, templates without expressions, global -`new URL("…")` calls without a base argument, and `const` bindings to those -forms. Dynamic values and `new URL(relative, base)` are ignored. +The rule checks string literals, templates without expressions, `const` +bindings to those, and global `new URL("…")` calls without a base argument. +Dynamic values, `new URL(relative, base)`, and `URL` objects bound to +a variable are ignored, since a `URL` object can be changed after it is +constructed. By default, only imports from `@fedify/vocab` are inspected, including `jsr:`/`npm:` and versioned specifiers. The deprecated diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 48ff33ff0..76f9ee6a9 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -246,6 +246,7 @@ export function checkRawPropertyIris( function staticString( node: Ast | undefined, seen = new Set(), + bound = false, ): { value: string; literal: Ast } | undefined { if (!node || seen.has(node)) return; seen.add(node); @@ -275,9 +276,13 @@ export function checkRawPropertyIris( return staticString( lookup(scopes.get(node), node.name as string)?.init, seen, + true, ); } if ( + // A URL object bound to a const can still be mutated, e.g., through its + // href setter, so only a URL constructed in place is known statically: + !bound && node.type === "NewExpression" && name(node.callee) === "URL" && ast(node.callee)?.type === "Identifier" && !lookup(scopes.get(node), "URL") diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index 087018ec8..f343a42ba 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -111,9 +111,8 @@ const cases: [string, string, string?][] = [ `${setup} read(obj, new URL("https://example/a b"));`, ], [ - "URL const", - `${setup} const iri = new URL("as:content"); read(obj, iri);`, - "non-HTTP scheme", + "URL const ignored, as it can be mutated", + `${setup} const iri = new URL("about:blank"); iri.href = "https://example/p"; read(obj, iri);`, ], [ "URL with base", From 32a23df2aca8149be48bd27c6db974c283fbd9ef Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 18:43:16 +0900 Subject: [PATCH 10/35] Update vocab-tools snapshots after rebase The rebase onto main brought in the attributionDomains property, for which the generated code now also emits a raw property descriptor. Changelog: none Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 165 +++++++++++++++++- .../src/__snapshots__/class.test.ts.node.snap | 165 +++++++++++++++++- .../src/__snapshots__/class.test.ts.snap | 165 +++++++++++++++++- 3 files changed, 480 insertions(+), 15 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index cd45b349a..6d70a378b 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -79588,6 +79588,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -87895,6 +87925,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -88166,7 +88197,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. @@ -106063,6 +106094,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -114370,6 +114431,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -114641,7 +114703,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. @@ -131112,6 +131174,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -139419,6 +139511,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -139690,7 +139783,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. @@ -144812,6 +144905,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -153119,6 +153242,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -153390,7 +153514,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. @@ -168925,6 +169049,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -177232,6 +177386,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -177503,7 +177658,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 1bccad605..087bfc3d3 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -79586,6 +79586,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -87893,6 +87923,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -88164,7 +88195,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. @@ -106061,6 +106092,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -114368,6 +114429,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -114639,7 +114701,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. @@ -131110,6 +131172,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -139417,6 +139509,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -139688,7 +139781,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. @@ -144810,6 +144903,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -153117,6 +153240,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -153388,7 +153512,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. @@ -168923,6 +169047,36 @@ array.push(element); }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); + descriptor = { + canonicalIri: \\"http://joinmastodon.org/ns#attributionDomains\\", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: \\"expand\\"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ \\"@value\\": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === \\"undefined\\") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); + descriptor = { canonicalIri: \\"https://www.w3.org/ns/activitystreams#movedTo\\", // Scalar encoders are mostly synchronous, but some are not: @@ -177230,6 +177384,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { \\"@value\\": v } ); @@ -177501,7 +177656,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set([\\"http://creativecommons.org/ns#license\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#attributionDomains\\",\\"http://joinmastodon.org/ns#discoverable\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://joinmastodon.org/ns#indexable\\",\\"http://joinmastodon.org/ns#memorial\\",\\"http://joinmastodon.org/ns#suspended\\",\\"http://purl.org/dc/terms/license\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#interactionPolicy\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_followedMessage\\",\\"https://misskey-hub.net/ns#isCat\\",\\"https://schema.org/license\\",\\"https://w3id.org/fep/22cd#translations\\",\\"https://w3id.org/fep/6757#preferredLicense\\",\\"https://w3id.org/fep/7aa9#featuredCollections\\",\\"https://w3id.org/fep/ef61/gateways\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#content\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#duration\\",\\"https://www.w3.org/ns/activitystreams#endTime\\",\\"https://www.w3.org/ns/activitystreams#endpoints\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\",\\"https://www.w3.org/ns/activitystreams#mediaType\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#name\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#preferredUsername\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#published\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#sensitive\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#source\\",\\"https://www.w3.org/ns/activitystreams#startTime\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#summary\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#updated\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\"]); /** * Converts a JSON-LD structure to an object of this type. diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 9727b172d..15c8ea13a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -79588,6 +79588,36 @@ array.push(element); }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#attributionDomains", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Application).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Application).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); + descriptor = { canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", // Scalar encoders are mostly synchronous, but some are not: @@ -87895,6 +87925,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { "@value": v } ); @@ -88166,7 +88197,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#attributionDomains","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); /** * Converts a JSON-LD structure to an object of this type. @@ -106063,6 +106094,36 @@ array.push(element); }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#attributionDomains", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Group).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Group).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); + descriptor = { canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", // Scalar encoders are mostly synchronous, but some are not: @@ -114370,6 +114431,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { "@value": v } ); @@ -114641,7 +114703,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#attributionDomains","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); /** * Converts a JSON-LD structure to an object of this type. @@ -131112,6 +131174,36 @@ array.push(element); }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#attributionDomains", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Organization).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Organization).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); + descriptor = { canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", // Scalar encoders are mostly synchronous, but some are not: @@ -139419,6 +139511,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { "@value": v } ); @@ -139690,7 +139783,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#attributionDomains","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); /** * Converts a JSON-LD structure to an object of this type. @@ -144812,6 +144905,36 @@ array.push(element); }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#attributionDomains", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Person).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Person).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); + descriptor = { canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", // Scalar encoders are mostly synchronous, but some are not: @@ -153119,6 +153242,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { "@value": v } ); @@ -153390,7 +153514,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#attributionDomains","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); /** * Converts a JSON-LD structure to an object of this type. @@ -168925,6 +169049,36 @@ array.push(element); }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); + descriptor = { + canonicalIri: "http://joinmastodon.org/ns#attributionDomains", + // Scalar encoders are mostly synchronous, but some are not: + // deno-lint-ignore require-await + async encode( + object: object, + options: { format: "expand"; contextLoader?: DocumentLoader }, + ): Promise { + const array: unknown[] = []; + for (const v of (object as Service).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + + let element = ( +{ "@value": v } + ); + if (Array.isArray(element)) { + if (element.length < 1) continue; + if (element.length == 1) element = element[0]; + } + if (typeof element === "undefined") continue; +array.push(element); + } + if (array.length < 1) return undefined; + return array; + }, + values(object: object): readonly unknown[] { + return (object as Service).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; + }, + }; + descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); + descriptor = { canonicalIri: "https://www.w3.org/ns/activitystreams#movedTo", // Scalar encoders are mostly synchronous, but some are not: @@ -177232,6 +177386,7 @@ get attributionDomains(): (string)[] { array = []; for (const v of this.#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains) { + let element = ( { "@value": v } ); @@ -177503,7 +177658,7 @@ get attributionDomains(): (string)[] { return super.isCompactable(); } - static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); + static readonly #knownRawPropertyIris: ReadonlySet = new Set(["http://creativecommons.org/ns#license","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#attributionDomains","http://joinmastodon.org/ns#discoverable","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://joinmastodon.org/ns#indexable","http://joinmastodon.org/ns#memorial","http://joinmastodon.org/ns#suspended","http://purl.org/dc/terms/license","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#interactionPolicy","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_followedMessage","https://misskey-hub.net/ns#isCat","https://schema.org/license","https://w3id.org/fep/22cd#translations","https://w3id.org/fep/6757#preferredLicense","https://w3id.org/fep/7aa9#featuredCollections","https://w3id.org/fep/ef61/gateways","https://w3id.org/security#assertionMethod","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#content","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#duration","https://www.w3.org/ns/activitystreams#endTime","https://www.w3.org/ns/activitystreams#endpoints","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers","https://www.w3.org/ns/activitystreams#mediaType","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#name","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#preferredUsername","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#published","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#sensitive","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#source","https://www.w3.org/ns/activitystreams#startTime","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#updated","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service"]); /** * Converts a JSON-LD structure to an object of this type. From 7365f13343ad1c38b6b9879bde4be8911a171369 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 19:12:28 +0900 Subject: [PATCH 11/35] Look up switch discriminants outside case scope The raw-property-iri-invalid rule visited a switch statement's discriminant in the same scope as its cases, so a const declared in a case shadowed the binding the discriminant actually reads. A call such as switch (read(obj, iri)) could then be reported for the case-local value instead of the IRI it passes at runtime. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4440760669 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 10 +++++++++- .../lint/src/tests/raw-property-iri-invalid.test.ts | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 76f9ee6a9..89cfb1119 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -239,7 +239,15 @@ export function checkRawPropertyIris( } } if (node.type === "CallExpression") calls.push(node); - for (const child of children(node)) visit(child, scope); + for (const child of children(node)) { + // The discriminant of a switch is evaluated outside its case scope: + visit( + child, + node.type === "SwitchStatement" && child === node.discriminant + ? outer + : scope, + ); + } } visit(program as unknown as Ast, root); diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index f343a42ba..f76fe4db8 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -163,6 +163,10 @@ cases.push( `${setup} read(obj, "constructor:property");`, "non-HTTP scheme", ], + [ + "switch discriminant outside case scope", + `${setup} const iri = "https://example/p"; switch (read(obj, iri)) { case 0: const iri = "content"; }`, + ], ["IPv6 authority", `${setup} read(obj, "https://[::1]/property");`], [ "escaped template", From 401c86c4de4331936ac37264085e9dfe5ae0f40c Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 19:13:19 +0900 Subject: [PATCH 12/35] Decode single-quoted literals in IRI lint exactly Deno's AST replaces an escaped lone surrogate in a string literal's value with U+FFFD. The raw-property-iri-invalid rule recovered the exact code units by parsing the raw source with JSON.parse(), but only for double-quoted literals, so read(obj, 'https://example/\uD800') went unreported although the runtime rejects it. Single-quoted literals are now rewritten as double-quoted ones before parsing; JavaScript-only escapes still fall back to the parser's value. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4440944054 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 26 +++++++++++++++++-- .../tests/raw-property-iri-invalid.test.ts | 18 +++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 89cfb1119..17e6a396c 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -147,6 +147,27 @@ function bind(pattern: unknown, scope: Scope, binding: Binding = {}): void { for (const element of node.elements as unknown[]) bind(element, scope); } } +/** + * Rewrites a single-quoted string literal's source as a double-quoted one, so + * that `JSON.parse()` can decode its escapes. Returns `null` for anything + * other than a string literal. + */ +function toJsonString(raw: string): string | null { + if (raw.startsWith('"')) return raw; + if (!raw.startsWith("'")) return null; + let result = '"'; + for (let i = 1; i < raw.length - 1; i++) { + const char = raw[i]; + if (char === "\\") { + const next = raw[++i]; + result += next === "'" ? "'" : char + next; + } else { + result += char === '"' ? '\\"' : char; + } + } + return result + '"'; +} + function lookup( scope: Scope | undefined, identifier: string, @@ -261,9 +282,10 @@ export function checkRawPropertyIris( if (node.type === "Literal" && typeof node.value === "string") { // Deno replaces escaped lone surrogates in Literal.value with U+FFFD. // JSON-compatible raw literals retain their exact code units. - if (typeof node.raw === "string" && node.raw.startsWith('"')) { + const raw = typeof node.raw === "string" ? toJsonString(node.raw) : null; + if (raw != null) { try { - const value: unknown = JSON.parse(node.raw); + const value: unknown = JSON.parse(raw); if (typeof value === "string") return { value, literal: node }; } catch { // JavaScript-only escapes (such as \x20) use the parser's value. diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index f76fe4db8..895950705 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -163,6 +163,24 @@ cases.push( `${setup} read(obj, "constructor:property");`, "non-HTTP scheme", ], + [ + "single-quoted lone surrogate", + `${setup} read(obj, 'https://example/\\uD800');`, + "must be a full", + ], + [ + "single-quoted surrogate pair", + `${setup} read(obj, 'https://example/\\uD83D\\uDE00');`, + ], + [ + "single-quoted double quote", + `${setup} read(obj, 'https://example/"\\u0070');`, + "must be a full", + ], + [ + "single-quoted valid", + `${setup} read(obj, 'https://example/\\u0070rop\\'s');`, + ], [ "switch discriminant outside case scope", `${setup} const iri = "https://example/p"; switch (read(obj, iri)) { case 0: const iri = "content"; }`, From 09af565aca5eaa93784f62f9313842600e950e10 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 19:25:47 +0900 Subject: [PATCH 13/35] Pair sibling-class properties by IRI When a reparse turns an embedded object into a sibling class, such as Service instead of Person, both classes declare properties like endpoints but through distinct descriptor objects. The traversal compared descriptors by identity, so it skipped those properties and the nested objects lost the unknown properties that relied on the parent's context. The source's descriptor is now looked up by the destination descriptor's property IRI, and each object is read through its own class's descriptor. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4441020203 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 18 ++++++------- .../src/__snapshots__/class.test.ts.node.snap | 18 ++++++------- .../src/__snapshots__/class.test.ts.snap | 18 ++++++------- packages/vocab-tools/src/raw-property.ts | 18 ++++++------- packages/vocab/src/raw-property.test.ts | 27 +++++++++++++++++++ 5 files changed, 63 insertions(+), 36 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 6d70a378b..f0b7dc758 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -476,8 +476,8 @@ function mergeRawProperties(source: object, destination: object): void { // id are paired. When the decoding dropped some values of a property, // positions no longer correspond, so nested objects are paired by id alone. // When the copy was decoded by a different class, the retained properties are -// merged rather than replaced, and only the properties both classes declare -// are followed: +// merged rather than replaced, and only the properties both classes declare, +// matched by their IRIs, are followed: function copyRawPropertiesDeep( source: object, destination: object, @@ -490,14 +490,14 @@ function copyRawPropertiesDeep( globalThis.Object.getPrototypeOf(destination); if (sameClass) copyRawProperties(source, destination); else mergeRawProperties(source, destination); - const sourceDescriptors = sameClass - ? undefined - : getRawPropertyDescriptors(source); for (const descriptor of getRawPropertyDescriptors(destination)) { - if (sourceDescriptors != null && !sourceDescriptors.has(descriptor)) { - continue; - } - const sources = descriptor.values(source); + // Sibling classes declare the same property with distinct descriptors, so + // each object is read through its own class's descriptor: + const sourceDescriptor = sameClass + ? descriptor + : getRawPropertyDescriptor(source, descriptor.canonicalIri); + if (sourceDescriptor == null) continue; + const sources = sourceDescriptor.values(source); const destinations = descriptor.values(destination); const aligned = sources.length === destinations.length; for (let i = 0; i < destinations.length; i++) { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 087bfc3d3..a77485927 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -474,8 +474,8 @@ function mergeRawProperties(source: object, destination: object): void { // id are paired. When the decoding dropped some values of a property, // positions no longer correspond, so nested objects are paired by id alone. // When the copy was decoded by a different class, the retained properties are -// merged rather than replaced, and only the properties both classes declare -// are followed: +// merged rather than replaced, and only the properties both classes declare, +// matched by their IRIs, are followed: function copyRawPropertiesDeep( source: object, destination: object, @@ -488,14 +488,14 @@ function copyRawPropertiesDeep( globalThis.Object.getPrototypeOf(destination); if (sameClass) copyRawProperties(source, destination); else mergeRawProperties(source, destination); - const sourceDescriptors = sameClass - ? undefined - : getRawPropertyDescriptors(source); for (const descriptor of getRawPropertyDescriptors(destination)) { - if (sourceDescriptors != null && !sourceDescriptors.has(descriptor)) { - continue; - } - const sources = descriptor.values(source); + // Sibling classes declare the same property with distinct descriptors, so + // each object is read through its own class's descriptor: + const sourceDescriptor = sameClass + ? descriptor + : getRawPropertyDescriptor(source, descriptor.canonicalIri); + if (sourceDescriptor == null) continue; + const sources = sourceDescriptor.values(source); const destinations = descriptor.values(destination); const aligned = sources.length === destinations.length; for (let i = 0; i < destinations.length; i++) { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 15c8ea13a..bd216045c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -476,8 +476,8 @@ function mergeRawProperties(source: object, destination: object): void { // id are paired. When the decoding dropped some values of a property, // positions no longer correspond, so nested objects are paired by id alone. // When the copy was decoded by a different class, the retained properties are -// merged rather than replaced, and only the properties both classes declare -// are followed: +// merged rather than replaced, and only the properties both classes declare, +// matched by their IRIs, are followed: function copyRawPropertiesDeep( source: object, destination: object, @@ -490,14 +490,14 @@ function copyRawPropertiesDeep( globalThis.Object.getPrototypeOf(destination); if (sameClass) copyRawProperties(source, destination); else mergeRawProperties(source, destination); - const sourceDescriptors = sameClass - ? undefined - : getRawPropertyDescriptors(source); for (const descriptor of getRawPropertyDescriptors(destination)) { - if (sourceDescriptors != null && !sourceDescriptors.has(descriptor)) { - continue; - } - const sources = descriptor.values(source); + // Sibling classes declare the same property with distinct descriptors, so + // each object is read through its own class's descriptor: + const sourceDescriptor = sameClass + ? descriptor + : getRawPropertyDescriptor(source, descriptor.canonicalIri); + if (sourceDescriptor == null) continue; + const sources = sourceDescriptor.values(source); const destinations = descriptor.values(destination); const aligned = sources.length === destinations.length; for (let i = 0; i < destinations.length; i++) { diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index ada3842fb..d67b05d8f 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -153,8 +153,8 @@ function mergeRawProperties(source: object, destination: object): void { // id are paired. When the decoding dropped some values of a property, // positions no longer correspond, so nested objects are paired by id alone. // When the copy was decoded by a different class, the retained properties are -// merged rather than replaced, and only the properties both classes declare -// are followed: +// merged rather than replaced, and only the properties both classes declare, +// matched by their IRIs, are followed: function copyRawPropertiesDeep( source: object, destination: object, @@ -167,14 +167,14 @@ function copyRawPropertiesDeep( globalThis.Object.getPrototypeOf(destination); if (sameClass) copyRawProperties(source, destination); else mergeRawProperties(source, destination); - const sourceDescriptors = sameClass - ? undefined - : getRawPropertyDescriptors(source); for (const descriptor of getRawPropertyDescriptors(destination)) { - if (sourceDescriptors != null && !sourceDescriptors.has(descriptor)) { - continue; - } - const sources = descriptor.values(source); + // Sibling classes declare the same property with distinct descriptors, so + // each object is read through its own class's descriptor: + const sourceDescriptor = sameClass + ? descriptor + : getRawPropertyDescriptor(source, descriptor.canonicalIri); + if (sourceDescriptor == null) continue; + const sources = sourceDescriptor.values(source); const destinations = descriptor.values(destination); const aligned = sources.length === destinations.length; for (let i = 0; i < destinations.length; i++) { diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index 287f1bee4..323f885c0 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -10,6 +10,7 @@ import { Object as ASObject, Person, Question, + Service, } from "./mod.ts"; const AS = "https://www.w3.org/ns/activitystreams"; @@ -248,6 +249,32 @@ test("getRawPropertyValues() keeps unknown properties when a reparse changes the ]); }); +test("getRawPropertyValues() follows properties shared by sibling classes", async () => { + const create = await Create.fromJsonLd({ + "@context": [AS, { Human: `${AS}#Person`, quant: QUANT }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": AS, + id: "https://example.com/users/bot", + // Only the outer context defines this type alias and prefix: + type: ["Human", "Service"], + endpoints: { + sharedInbox: "https://example.com/inbox", + "quant:structuredUrl": { "@id": "https://example.com/data/1" }, + }, + }, + }); + const actor = await create.getObject(); + ok(actor instanceof Service); + const endpoints = actor.endpoints; + ok(endpoints != null); + deepStrictEqual(await getRawPropertyValues(endpoints, STRUCTURED_URL), [ + { "@id": "https://example.com/data/1" }, + ]); +}); + test("getRawPropertyValues() keeps unknown properties across copies", async () => { const note = await Note.fromJsonLd(structuredNote); const expected = [{ "@id": "https://example.com/data/1?token=abc" }]; From eddea18960efd596b05f6b1760c6712ee65b0988 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 2 Nov 2026 19:56:01 +0900 Subject: [PATCH 14/35] Scope TypeScript namespace bodies in IRI lint The raw-property-iri-invalid rule collected declarations inside a TypeScript namespace body into the surrounding scope, so a const in the namespace overwrote an outer binding of the same name. A call outside the namespace could then be reported for the namespace's value instead of the IRI it passes at runtime. Namespace bodies now get their own scope, which also holds their var declarations, since TypeScript compiles a namespace body to a function body. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4441396716 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 5 ++++- packages/lint/src/tests/raw-property-iri-invalid.test.ts | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 17e6a396c..3409f3cf4 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -208,11 +208,14 @@ export function checkRawPropertyIris( "ClassExpression", "ClassDeclaration", "StaticBlock", + "TSModuleBlock", ].includes(node.type); const scope: Scope = scoped ? { parent: outer, - functionScope: isFunction || node.type === "StaticBlock", + // A TypeScript namespace body is compiled to a function body: + functionScope: isFunction || node.type === "StaticBlock" || + node.type === "TSModuleBlock", bindings: new Map(), } : outer; diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index 895950705..d0b076aef 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -185,6 +185,15 @@ cases.push( "switch discriminant outside case scope", `${setup} const iri = "https://example/p"; switch (read(obj, iri)) { case 0: const iri = "content"; }`, ], + [ + "namespace body scope", + `${setup} const iri = "https://example/p"; namespace N { export const iri = "content"; var other = 1; } read(obj, iri);`, + ], + [ + "inside namespace body", + `${setup} namespace N { const iri = "content"; read(obj, iri); }`, + "must be a full", + ], ["IPv6 authority", `${setup} read(obj, "https://[::1]/property");`], [ "escaped template", From f3a54e56b3f6c755c47dd0c50d3e52740ca8cfc7 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 5 Nov 2026 15:13:07 +0900 Subject: [PATCH 15/35] Bind namespace and enum names in IRI lint The raw-property-iri-invalid rule bound only function and class declaration names, so a TypeScript namespace or enum declared with the same name as a namespace import did not shadow it. A call such as vocab.getRawPropertyValue({}, "content") inside code that declared namespace vocab {} was then reported, although it does not call the imported function. Namespace and enum declarations now bind their names like function and class declarations. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4476942211 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 6 +++++- packages/lint/src/tests/raw-property-iri-invalid.test.ts | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 3409f3cf4..f09dc9e9e 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -194,7 +194,11 @@ export function checkRawPropertyIris( /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/ .test(node.type); if ( - node.type === "FunctionDeclaration" || node.type === "ClassDeclaration" + node.type === "FunctionDeclaration" || + node.type === "ClassDeclaration" || + // Namespaces and enums also declare a value binding: + node.type === "TSModuleDeclaration" || + node.type === "TSEnumDeclaration" ) { bind(node.id, outer); } diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index d0b076aef..fa3ca3e28 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -194,6 +194,14 @@ cases.push( `${setup} namespace N { const iri = "content"; read(obj, iri); }`, "must be a full", ], + [ + "namespace shadows namespace import", + 'import * as vocab from "@fedify/vocab"; namespace vocab { export function getRawPropertyValue(o: unknown, i: string) {} } vocab.getRawPropertyValue({}, "content");', + ], + [ + "enum shadows namespace import", + 'import * as vocab from "@fedify/vocab"; enum vocab { getRawPropertyValue } vocab.getRawPropertyValue({}, "content");', + ], ["IPv6 authority", `${setup} read(obj, "https://[::1]/property");`], [ "escaped template", From 89bde9e7bd2e3ec3d9e0f54602d06cfe69a0be05 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 5 Nov 2026 15:42:43 +0900 Subject: [PATCH 16/35] Decode cached embedded objects in parent context Accessors decode an embedded object that has its own @context again from the parent's cached JSON-LD, so that the returned object keeps its original JSON-LD. That decoding saw only the embedded object's own context, not the enclosing document's. A type or property term that only the parent defined could therefore yield an object of another class or drop property values, and the raw property retention tried to make up for it by pairing the reparsed objects with the originally decoded ones, which cannot be done reliably. The accessors also took the cached documents under the property's default term even when the parent's context remapped that term, returning entirely different objects. The cached embedded document is now decoded with the parent's context prepended, leaving out the entries its own context repeats, so terms resolve as they did for the whole document. Before that, the parent's context is checked to map the default term, and no other term, to the property; otherwise the accessor keeps the object decoded with the whole document. With these, the reparsed object retains the same unknown properties by itself, so the pairing helpers are removed. The tests for reparse failures relied on a type alias defined only in the parent's context, which now resolves. They use a property-scoped context instead, which a reparse of the embedded object alone still cannot apply. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4476939693 https://github.com/fedify-dev/fedify/pull/1356#discussion_r4476940633 Assisted-by: Claude Code:claude-opus-5-5 --- CHANGES.md | 18 + .../vocab-tools/embedded-object-context.md | 9 + changes.d/vocab/embedded-object-context.md | 16 + .../src/__snapshots__/class.test.ts.deno.snap | 6668 +++++++++-------- .../src/__snapshots__/class.test.ts.node.snap | 6668 +++++++++-------- .../src/__snapshots__/class.test.ts.snap | 6668 +++++++++-------- packages/vocab-tools/src/property.ts | 70 +- packages/vocab-tools/src/raw-property.ts | 165 +- packages/vocab/src/raw-property.test.ts | 139 +- packages/vocab/src/vocab.test.ts | 9 +- 10 files changed, 11131 insertions(+), 9299 deletions(-) create mode 100644 changes.d/vocab-tools/embedded-object-context.md create mode 100644 changes.d/vocab/embedded-object-context.md diff --git a/CHANGES.md b/CHANGES.md index 4f7d34012..f6b5b881e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -358,6 +358,19 @@ To be released. - Fedify does not fill in a default license for objects without license metadata and never fetches a license URI. + - Fixed accessors of objects decoded by `fromJsonLd()` returning wrong + values for embedded objects that have their own `@context`. Such an + object was decoded again from its cached JSON-LD without the enclosing + document's context, so a type or property term that only the enclosing + context defined could yield an object of another class or drop + property values. It could also pick embedded objects under a term that + the enclosing context mapped to another property. The accessors now + apply the enclosing context and fall back to the object decoded with the + whole document when the cached JSON-LD cannot be matched with it. + The `toJsonLd()` result of such an embedded object now also includes the + entries of the enclosing context that its own context does not repeat, + so it means the same when used on its own. [[#1356]] + [FEP-6757]: https://w3id.org/fep/6757 [#1212]: https://github.com/fedify-dev/fedify/issues/1212 [#1241]: https://github.com/fedify-dev/fedify/pull/1241 @@ -407,6 +420,11 @@ To be released. `https://w3id.org/identity/v1`. Previously, such a property compacted to a prefixed name like `dc:license` without the extra context. [[#1212], [#1241]] + - Fixed generated accessors decoding embedded objects that have their own + `@context` without the enclosing document's context, which could + return objects of another class, drop property values, or pick objects + under a term the enclosing context mapped to another property. + [[#1356]] - Generated vocabulary modules now export `getRawPropertyValues()` and `getRawPropertyValue()`, which read any property of a generated object by its full IRI, and their root classes implement `VocabularyObject` from diff --git a/changes.d/vocab-tools/embedded-object-context.md b/changes.d/vocab-tools/embedded-object-context.md new file mode 100644 index 000000000..8e47f3450 --- /dev/null +++ b/changes.d/vocab-tools/embedded-object-context.md @@ -0,0 +1,9 @@ +--- +links: + '#1356': https://github.com/fedify-dev/fedify/pull/1356 +--- + - Fixed generated accessors decoding embedded objects that have their own + `@context` without the enclosing document's context, which could + return objects of another class, drop property values, or pick objects + under a term the enclosing context mapped to another property. + [[#1356]] diff --git a/changes.d/vocab/embedded-object-context.md b/changes.d/vocab/embedded-object-context.md new file mode 100644 index 000000000..2b94ac5ae --- /dev/null +++ b/changes.d/vocab/embedded-object-context.md @@ -0,0 +1,16 @@ +--- +links: + '#1356': https://github.com/fedify-dev/fedify/pull/1356 +--- + - Fixed accessors of objects decoded by `fromJsonLd()` returning wrong + values for embedded objects that have their own `@context`. Such an + object was decoded again from its cached JSON-LD without the enclosing + document's context, so a type or property term that only the enclosing + context defined could yield an object of another class or drop + property values. It could also pick embedded objects under a term that + the enclosing context mapped to another property. The accessors now + apply the enclosing context and fall back to the object decoded with the + whole document when the cached JSON-LD cannot be matched with it. + The `toJsonLd()` result of such an embedded object now also includes the + entries of the enclosing context that its own context does not repeat, + so it means the same when used on its own. [[#1356]] diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index f0b7dc758..5bf545b9c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -389,7 +389,6 @@ type RawPropertyEncoder = ( interface RawPropertyDescriptor { readonly canonicalIri: string; readonly encode: RawPropertyEncoder; - readonly values: (object: object) => readonly unknown[]; } // Unknown properties retained while decoding, keyed by the decoded object: @@ -421,97 +420,88 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } -function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { - if ( - source == null || destination == null || - typeof source !== \\"object\\" || typeof destination !== \\"object\\" || - !(RAW_PROPERTY_PROTOCOL in source) || !(RAW_PROPERTY_PROTOCOL in destination) - ) { - return false; - } - const sourceId = (source as unknown as { id: URL | null }).id; - const destinationId = (destination as unknown as { id: URL | null }).id; - return sourceId?.href === destinationId?.href; +// Embeds the context of a cached document in a document embedded in it, so +// that decoding the embedded document alone resolves its terms the same way +// as decoding the whole document did. Entries that the embedded document's +// own context repeats are left out, since applying them again later yields +// the same terms. Property-scoped contexts of the parent are not applied, as +// the embedded document is decoded as a top-level node: +function inheritJsonLdContext( + parentContext: unknown, + document: object, +): object { + const own = (document as { \\"@context\\"?: unknown })[\\"@context\\"]; + const ownEntries = globalThis.Array.isArray(own) ? own : [own]; + const ownKeys = new Set( + ownEntries.map((entry) => globalThis.JSON.stringify(entry)), + ); + const context = [ + ...(globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]).filter((entry) => + !ownKeys.has(globalThis.JSON.stringify(entry)) + ), + ...ownEntries, + ]; + return { + ...document, + \\"@context\\": context.length === 1 ? context[0] : context, + }; } -function getRawPropertyDescriptors(object: object): Set { - const descriptors = new Set(); - let prototype: object | null = globalThis.Object.getPrototypeOf(object); - while (prototype != null) { - for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { - descriptors.add(descriptor); - } - prototype = globalThis.Object.getPrototypeOf(prototype); - } - return descriptors; -} +// The property IRIs each key of a compacted document expands to, keyed by +// the document: +const expandedKeys = new WeakMap>>(); -// Merges the retained unknown properties of a decoded object into a copy that -// was decoded again by a different class. The classes classify properties -// differently, so the copy keeps what it retained itself and gains the -// original's values for the properties its own class does not know either: -function mergeRawProperties(source: object, destination: object): void { - const retained = retainedRawProperties.get(source); - if (retained == null) return; - const merged: Record = { - ...retainedRawProperties.get(destination), - }; - let changed = false; - for (const [iri, values] of globalThis.Object.entries(retained)) { - if (getRawPropertyDescriptor(destination, iri) != null) continue; - merged[iri] = values; - changed = true; - } - if (changed) { - retainedRawProperties.set( - destination, - globalThis.Object.freeze(merged) as RetainedRawProperties, - ); - } +function expandKey( + document: Record, + key: string, + contextLoader: DocumentLoader, +): Promise { + let keys = expandedKeys.get(document); + if (keys == null) { + keys = new Map(); + expandedKeys.set(document, keys); + } + const cached = keys.get(key); + if (cached != null) return cached; + const iris = jsonld.expand( + { \\"@context\\": document[\\"@context\\"], [key]: [] }, + { documentLoader: contextLoader, keepFreeFloatingNodes: true }, + ).then((expanded: unknown[]) => + globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => + !iri.startsWith(\\"@\\") + ) + ); + // A failure, such as of the context loader, is not remembered, as another + // call can pass another loader: + const map = keys; + iris.catch(() => map.delete(key)); + keys.set(key, iris); + return iris; } -// Copies the retained unknown properties of a decoded object and of the -// objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. Only objects with the same -// id are paired. When the decoding dropped some values of a property, -// positions no longer correspond, so nested objects are paired by id alone. -// When the copy was decoded by a different class, the retained properties are -// merged rather than replaced, and only the properties both classes declare, -// matched by their IRIs, are followed: -function copyRawPropertiesDeep( - source: object, - destination: object, - visited: Set = new Set(), -): void { - if (visited.has(destination)) return; - visited.add(destination); - if (!isSameRawPropertyNode(source, destination)) return; - const sameClass = globalThis.Object.getPrototypeOf(source) === - globalThis.Object.getPrototypeOf(destination); - if (sameClass) copyRawProperties(source, destination); - else mergeRawProperties(source, destination); - for (const descriptor of getRawPropertyDescriptors(destination)) { - // Sibling classes declare the same property with distinct descriptors, so - // each object is read through its own class's descriptor: - const sourceDescriptor = sameClass - ? descriptor - : getRawPropertyDescriptor(source, descriptor.canonicalIri); - if (sourceDescriptor == null) continue; - const sources = sourceDescriptor.values(source); - const destinations = descriptor.values(destination); - const aligned = sources.length === destinations.length; - for (let i = 0; i < destinations.length; i++) { - const destination = destinations[i]; - const source = aligned - ? sources[i] - : (destination as { id?: URL | null } | null)?.id == null - ? undefined - : sources.find((s) => isSameRawPropertyNode(s, destination)); - if (source !== destination && isSameRawPropertyNode(source, destination)) { - copyRawPropertiesDeep(source as object, destination as object, visited); - } - } - } +// Whether a compacted document maps the given key, and no other key, to +// a property, so that the embedded documents under the key are the values +// decoded for the property. A context can remap the key to another property +// or map another term to the property, in which case the cached documents +// cannot be matched with the decoded values: +async function isCachedPropertyKey( + document: Record, + key: string, + iris: readonly string[], + contextLoader: DocumentLoader, +): Promise { + const own = await expandKey(document, key, contextLoader); + if (own.length !== 1 || own[0] !== iris[0]) return false; + const others = await globalThis.Promise.all( + globalThis.Object.keys(document) + .filter((k) => k !== key && !k.startsWith(\\"@\\")) + // Keyword aliases, such as id, cannot take an empty array, and are + // not properties anyway: + .map((k) => expandKey(document, k, contextLoader).catch(() => [])), + ); + return !others.flat().some((iri) => iris.includes(iri)); } async function readRawProperty( @@ -4820,9 +4810,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#attachment\\", descriptor); @@ -4870,9 +4857,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#attributedTo\\", descriptor); @@ -4904,9 +4888,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#audience\\", descriptor); @@ -4937,9 +4918,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#content\\", descriptor); @@ -4975,9 +4953,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3mhZzGXSpQ431mBSz2kvych22v4e_context; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#context\\", descriptor); @@ -5008,9 +4983,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); @@ -5041,9 +5013,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endTime\\", descriptor); @@ -5079,9 +5048,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#generator\\", descriptor); @@ -5113,9 +5079,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#icon\\", descriptor); @@ -5147,9 +5110,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#image\\", descriptor); @@ -5185,9 +5145,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#inReplyTo\\", descriptor); @@ -5223,9 +5180,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#location\\", descriptor); @@ -5261,9 +5215,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preview\\", descriptor); @@ -5294,9 +5245,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_5e258TDXtuhaFRPZiGoDfEpjdMr_published; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#published\\", descriptor); @@ -5328,9 +5276,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_7UpwM3JWcXhADcscukEehBorf6k_replies; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#replies\\", descriptor); @@ -5362,9 +5307,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3kAfck9PcEYt2L7xug5y99YPbANs_shares; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#shares\\", descriptor); @@ -5396,9 +5338,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#likes\\", descriptor); @@ -5430,9 +5369,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions; - }, }; descriptors.set(\\"http://fedibird.com/ns#emojiReactions\\", descriptor); @@ -5463,9 +5399,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2w3Jmue4up8iVDUA51WZqomEF438_startTime; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#startTime\\", descriptor); @@ -5496,9 +5429,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#summary\\", descriptor); @@ -5534,9 +5464,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_5chuqj6s95p5gg2sk1HntGfarRf_tag; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#tag\\", descriptor); @@ -5567,9 +5494,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#updated\\", descriptor); @@ -5601,9 +5525,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#url\\", descriptor); @@ -5635,9 +5556,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#to\\", descriptor); @@ -5669,9 +5587,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#bto\\", descriptor); @@ -5703,9 +5618,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#cc\\", descriptor); @@ -5737,9 +5649,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#bcc\\", descriptor); @@ -5767,9 +5676,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); @@ -5800,9 +5706,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#duration\\", descriptor); @@ -5830,9 +5733,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#sensitive\\", descriptor); @@ -5864,9 +5764,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#source\\", descriptor); @@ -5898,9 +5795,6 @@ array.push({ \\"@graph\\": element }); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; - }, }; descriptors.set(\\"https://w3id.org/security#proof\\", descriptor); @@ -5932,9 +5826,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionPolicy\\", descriptor); @@ -5962,9 +5853,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; - }, }; descriptors.set(\\"https://gotosocial.org/ns#approvedBy\\", descriptor); @@ -5996,9 +5884,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; - }, }; descriptors.set(\\"https://gotosocial.org/ns#likeAuthorization\\", descriptor); @@ -6030,9 +5915,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; - }, }; descriptors.set(\\"https://gotosocial.org/ns#replyAuthorization\\", descriptor); @@ -6064,9 +5946,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization; - }, }; descriptors.set(\\"https://gotosocial.org/ns#announceAuthorization\\", descriptor); @@ -6098,9 +5977,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations; - }, }; descriptors.set(\\"https://w3id.org/fep/22cd#translations\\", descriptor); @@ -6128,9 +6004,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; - }, }; descriptors.set(\\"http://purl.org/dc/terms/license\\", descriptor); descriptors.set(\\"https://schema.org/license\\", descriptor); @@ -6540,23 +6413,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#attachment_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"attachment\\", + [\\"https://www.w3.org/ns/activitystreams#attachment\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#attachment_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7028,23 +6909,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#attribution_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"attributedTo\\", + [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#attribution_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7197,23 +7086,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#attribution_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"attributedTo\\", + [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#attribution_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7624,23 +7521,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#audience_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"audience\\", + [\\"https://www.w3.org/ns/activitystreams#audience\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#audience_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7792,23 +7697,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#audience_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"audience\\", + [\\"https://www.w3.org/ns/activitystreams#audience\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#audience_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8272,23 +8185,31 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#context_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"context\\", + [\\"https://www.w3.org/ns/activitystreams#context\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#context_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8759,23 +8680,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#generator_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"generator\\", + [\\"https://www.w3.org/ns/activitystreams#generator\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#generator_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9209,23 +9138,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#icon_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"icon\\", + [\\"https://www.w3.org/ns/activitystreams#icon\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#icon_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9378,23 +9315,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#icon_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"icon\\", + [\\"https://www.w3.org/ns/activitystreams#icon\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#icon_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9828,23 +9773,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#image_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"image\\", + [\\"https://www.w3.org/ns/activitystreams#image\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#image_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9997,23 +9950,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#image_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"image\\", + [\\"https://www.w3.org/ns/activitystreams#image\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#image_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10439,23 +10400,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#replyTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inReplyTo\\", + [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replyTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10607,23 +10576,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#replyTarget_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inReplyTo\\", + [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replyTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11049,23 +11026,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#location_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"location\\", + [\\"https://www.w3.org/ns/activitystreams#location\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#location_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11217,23 +11202,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#location_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"location\\", + [\\"https://www.w3.org/ns/activitystreams#location\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#location_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11658,23 +11651,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#preview_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"preview\\", + [\\"https://www.w3.org/ns/activitystreams#preview\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#preview_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11825,23 +11826,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#preview_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"preview\\", + [\\"https://www.w3.org/ns/activitystreams#preview\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#preview_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12265,23 +12274,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#replies_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"replies\\", + [\\"https://www.w3.org/ns/activitystreams#replies\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replies_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12697,23 +12714,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#shares_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"shares\\", + [\\"https://www.w3.org/ns/activitystreams#shares\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#shares_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13129,23 +13154,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#likes_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"likes\\", + [\\"https://www.w3.org/ns/activitystreams#likes\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likes_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13555,23 +13588,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#emojiReactions_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"emojiReactions\\", + [\\"http://fedibird.com/ns#emojiReactions\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#emojiReactions_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14042,23 +14083,31 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#tag_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"tag\\", + [\\"https://www.w3.org/ns/activitystreams#tag\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#tag_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14503,23 +14552,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#to_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"to\\", + [\\"https://www.w3.org/ns/activitystreams#to\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#to_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14671,23 +14728,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#to_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"to\\", + [\\"https://www.w3.org/ns/activitystreams#to\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#to_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15098,23 +15163,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#bto_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"bto\\", + [\\"https://www.w3.org/ns/activitystreams#bto\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bto_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15266,23 +15339,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#bto_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"bto\\", + [\\"https://www.w3.org/ns/activitystreams#bto\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bto_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15693,23 +15774,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#cc_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"cc\\", + [\\"https://www.w3.org/ns/activitystreams#cc\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#cc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15861,23 +15950,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#cc_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"cc\\", + [\\"https://www.w3.org/ns/activitystreams#cc\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#cc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16288,23 +16385,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#bcc_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"bcc\\", + [\\"https://www.w3.org/ns/activitystreams#bcc\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bcc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16456,23 +16561,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#bcc_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"bcc\\", + [\\"https://www.w3.org/ns/activitystreams#bcc\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bcc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16946,23 +17059,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#proof_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"proof\\", + [\\"https://w3id.org/security#proof\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#proof_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -17113,23 +17234,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#proof_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"proof\\", + [\\"https://w3id.org/security#proof\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#proof_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -17579,23 +17708,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#likeAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"likeAuthorization\\", + [\\"https://gotosocial.org/ns#likeAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likeAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -18005,23 +18142,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#replyAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"replyAuthorization\\", + [\\"https://gotosocial.org/ns#replyAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replyAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -18431,23 +18576,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#announceAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"announceAuthorization\\", + [\\"https://gotosocial.org/ns#announceAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#announceAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -24551,9 +24704,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ChatMessage).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); @@ -24581,9 +24731,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ChatMessage).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); @@ -24617,9 +24764,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ChatMessage).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -24993,23 +25137,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quote\\", + [\\"https://w3id.org/fep/044f#quote\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -25442,23 +25594,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quoteAuthorization\\", + [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27371,9 +27531,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#actor\\", descriptor); @@ -27405,9 +27562,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#object\\", descriptor); @@ -27439,9 +27593,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#target\\", descriptor); @@ -27473,9 +27624,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#result\\", descriptor); @@ -27507,9 +27655,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_25zu2s3VxVujgEKqrDycjE284XQR_origin; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#origin\\", descriptor); @@ -27541,9 +27686,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#instrument\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -27977,23 +28119,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#actor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"actor\\", + [\\"https://www.w3.org/ns/activitystreams#actor\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#actor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28146,23 +28296,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#actor_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"actor\\", + [\\"https://www.w3.org/ns/activitystreams#actor\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#actor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28574,23 +28732,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#object_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"object\\", + [\\"https://www.w3.org/ns/activitystreams#object\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28743,23 +28909,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#object_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"object\\", + [\\"https://www.w3.org/ns/activitystreams#object\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -29174,23 +29348,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#target_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"target\\", + [\\"https://www.w3.org/ns/activitystreams#target\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#target_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -29346,23 +29528,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#target_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"target\\", + [\\"https://www.w3.org/ns/activitystreams#target\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#target_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -29774,23 +29964,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#result_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"result\\", + [\\"https://www.w3.org/ns/activitystreams#result\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#result_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -29943,23 +30141,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#result_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"result\\", + [\\"https://www.w3.org/ns/activitystreams#result\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#result_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -30372,23 +30578,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#origin_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"origin\\", + [\\"https://www.w3.org/ns/activitystreams#origin\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#origin_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -30542,23 +30756,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#origin_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"origin\\", + [\\"https://www.w3.org/ns/activitystreams#origin\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#origin_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -30969,23 +31191,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#instrument_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"instrument\\", + [\\"https://www.w3.org/ns/activitystreams#instrument\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#instrument_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -31137,23 +31367,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#instrument_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"instrument\\", + [\\"https://www.w3.org/ns/activitystreams#instrument\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#instrument_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -33200,9 +33438,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as PropertyValue).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); @@ -33233,9 +33468,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as PropertyValue).#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value; - }, }; descriptors.set(\\"http://schema.org#value\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -34159,9 +34391,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Measure).#_27fgyFbosTtMAhuepJH8K3ZGURT6; - }, }; descriptors.set(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\", descriptor); @@ -34192,9 +34421,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Measure).#_1GQx8o2RgxRs4x9G5uT39XYBv7D; - }, }; descriptors.set(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -35081,9 +35307,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as AnnounceAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -35115,9 +35338,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as AnnounceAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -35490,23 +35710,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -35915,23 +36143,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -37655,9 +37891,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#canFeature\\", descriptor); @@ -37689,9 +37922,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike; - }, }; descriptors.set(\\"https://gotosocial.org/ns#canLike\\", descriptor); @@ -37723,9 +37953,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply; - }, }; descriptors.set(\\"https://gotosocial.org/ns#canReply\\", descriptor); @@ -37757,9 +37984,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce; - }, }; descriptors.set(\\"https://gotosocial.org/ns#canAnnounce\\", descriptor); @@ -37791,9 +38015,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; - }, }; descriptors.set(\\"https://gotosocial.org/ns#canQuote\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -39252,9 +39473,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionRule).#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval; - }, }; descriptors.set(\\"https://gotosocial.org/ns#automaticApproval\\", descriptor); @@ -39282,9 +39500,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionRule).#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; - }, }; descriptors.set(\\"https://gotosocial.org/ns#manualApproval\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -40151,9 +40366,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as LikeAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -40185,9 +40397,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as LikeAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -40560,23 +40769,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -40985,23 +41202,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -42503,9 +42728,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ReplyAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -42537,9 +42759,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ReplyAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -42912,23 +43131,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -43337,23 +43564,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -44855,9 +45090,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as QuoteAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -44889,9 +45121,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as QuoteAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -45263,23 +45492,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -45688,23 +45925,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -47633,9 +47878,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_diXuPmFWiEqfLPhhrxg6Xc7ixZG; - }, }; descriptors.set(\\"https://schema.org/inLanguage\\", descriptor); @@ -47683,9 +47925,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; - }, }; descriptors.set(\\"https://schema.org/translator\\", descriptor); @@ -47713,9 +47952,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_Msz9PwRg7cWkiXPL4ixyQLtuuH7; - }, }; descriptors.set(\\"https://schema.org/translationOfWork\\", descriptor); @@ -47746,9 +47982,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated; - }, }; descriptors.set(\\"https://w3id.org/fep/22cd#sourceUpdated\\", descriptor); @@ -47776,9 +48009,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_4KvkQNz1JjGs8S7iJDcGrUYETbUW; - }, }; descriptors.set(\\"https://schema.org/isBasedOn\\", descriptor); @@ -47810,9 +48040,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#url\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -48264,23 +48491,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#translator_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"translator\\", + [\\"https://schema.org/translator\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#translator_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -48436,23 +48671,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#translator_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"translator\\", + [\\"https://schema.org/translator\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#translator_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -49888,9 +50131,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeatureAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -49922,9 +50162,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeatureAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -50295,23 +50532,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -50719,23 +50964,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -52864,9 +53117,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#totalItems\\", descriptor); @@ -52898,9 +53148,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_3UyUdxnyn6cDn53QKrh4MBiearma_current; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#current\\", descriptor); @@ -52932,9 +53179,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_J52RqweMe6hhv7RnLJMC8BExTE5_first; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#first\\", descriptor); @@ -52966,9 +53210,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#last\\", descriptor); @@ -53004,9 +53245,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); @@ -53038,9 +53276,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#likesOf\\", descriptor); @@ -53072,9 +53307,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#sharesOf\\", descriptor); @@ -53106,9 +53338,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#repliesOf\\", descriptor); @@ -53140,9 +53369,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#inboxOf\\", descriptor); @@ -53174,9 +53400,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#outboxOf\\", descriptor); @@ -53208,9 +53431,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#followersOf\\", descriptor); @@ -53242,9 +53462,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#followingOf\\", descriptor); @@ -53276,9 +53493,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#likedOf\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -53667,23 +53881,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#current_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"current\\", + [\\"https://www.w3.org/ns/activitystreams#current\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#current_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -54093,23 +54315,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#first_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"first\\", + [\\"https://www.w3.org/ns/activitystreams#first\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#first_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -54519,23 +54749,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#last_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"last\\", + [\\"https://www.w3.org/ns/activitystreams#last\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#last_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -54964,23 +55202,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#item_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"items\\", + [\\"https://www.w3.org/ns/activitystreams#items\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#item_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -55390,23 +55636,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#likesOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"likesOf\\", + [\\"https://w3id.org/fep/5711#likesOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likesOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -55815,23 +56069,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#sharesOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"sharesOf\\", + [\\"https://w3id.org/fep/5711#sharesOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#sharesOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -56240,23 +56502,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#repliesOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"repliesOf\\", + [\\"https://w3id.org/fep/5711#repliesOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#repliesOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -56665,23 +56935,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inboxOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inboxOf\\", + [\\"https://w3id.org/fep/5711#inboxOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inboxOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -57090,23 +57368,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outboxOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outboxOf\\", + [\\"https://w3id.org/fep/5711#outboxOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outboxOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -57515,23 +57801,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followersOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followersOf\\", + [\\"https://w3id.org/fep/5711#followersOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followersOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -57940,23 +58234,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followingOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followingOf\\", + [\\"https://w3id.org/fep/5711#followingOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followingOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -58365,23 +58667,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#likedOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"likedOf\\", + [\\"https://w3id.org/fep/5711#likedOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likedOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -60575,9 +60885,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as OrderedCollection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -60969,23 +61276,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#item_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"orderedItems\\", + [\\"https://www.w3.org/ns/activitystreams#items\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#item_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -61819,9 +62134,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedCollection).#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#topic\\", descriptor); @@ -61849,9 +62161,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedCollection).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -62764,9 +63073,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedItem).#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredObject\\", descriptor); @@ -62798,9 +63104,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedItem).#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featureAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -63171,23 +63474,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredObject\\", + [\\"https://w3id.org/fep/7aa9#featuredObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -63597,23 +63908,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featureAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featureAuthorization\\", + [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featureAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -64682,9 +65001,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DidService).#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#serviceEndpoint\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -66070,9 +66386,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite; - }, }; descriptors.set(\\"https://w3id.org/security#cryptosuite\\", descriptor); @@ -66104,9 +66417,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod; - }, }; descriptors.set(\\"https://w3id.org/security#verificationMethod\\", descriptor); @@ -66136,9 +66446,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose; - }, }; descriptors.set(\\"https://w3id.org/security#proofPurpose\\", descriptor); @@ -66169,9 +66476,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue; - }, }; descriptors.set(\\"https://w3id.org/security#proofValue\\", descriptor); @@ -66202,9 +66506,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_3qzP3ukEZoUziK5FEiA1RhU4aqac; - }, }; descriptors.set(\\"http://purl.org/dc/terms/created\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -67772,9 +68073,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CryptographicKey).#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner; - }, }; descriptors.set(\\"https://w3id.org/security#owner\\", descriptor); @@ -67802,9 +68100,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CryptographicKey).#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem; - }, }; descriptors.set(\\"https://w3id.org/security#publicKeyPem\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -68235,23 +68530,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#owner_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"owner\\", + [\\"https://w3id.org/security#owner\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#owner_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -69320,9 +69623,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Multikey).#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller; - }, }; descriptors.set(\\"https://w3id.org/security#controller\\", descriptor); @@ -69353,9 +69653,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Multikey).#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase; - }, }; descriptors.set(\\"https://w3id.org/security#publicKeyMultibase\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -69786,23 +70083,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#controller_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"controller\\", + [\\"https://w3id.org/security#controller\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#controller_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -70799,9 +71104,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Agreement).#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#stipulates\\", descriptor); @@ -70833,9 +71135,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Agreement).#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#stipulatesReciprocal\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -71834,9 +72133,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Commitment).#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#satisfies\\", descriptor); @@ -71868,9 +72164,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Commitment).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -72962,9 +73255,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#action\\", descriptor); @@ -72992,9 +73282,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\", descriptor); @@ -73026,9 +73313,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", descriptor); @@ -73060,9 +73344,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#availableQuantity\\", descriptor); @@ -73094,9 +73375,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -74372,9 +74650,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#purpose\\", descriptor); @@ -74406,9 +74681,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#publishes\\", descriptor); @@ -74440,9 +74712,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#reciprocal\\", descriptor); @@ -74470,9 +74739,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#unitBased\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -78986,9 +79252,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -79020,9 +79283,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -79054,9 +79314,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -79084,9 +79341,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Application).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -79114,9 +79368,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -79152,9 +79403,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -79190,9 +79438,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -79224,9 +79469,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -79258,9 +79500,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -79292,9 +79531,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -79326,9 +79562,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -79360,9 +79593,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -79394,9 +79624,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -79428,9 +79655,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -79462,9 +79686,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -79492,9 +79713,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -79522,9 +79740,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -79552,9 +79767,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -79582,9 +79794,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -79612,9 +79821,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -79662,9 +79868,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -79712,9 +79915,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -79746,9 +79946,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -79776,9 +79973,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -79806,9 +80000,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -79836,9 +80027,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -80232,23 +80420,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -80398,23 +80594,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -80827,23 +81031,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -80997,23 +81209,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -81496,23 +81716,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -81945,23 +82173,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -82374,23 +82610,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -82806,23 +83050,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -83236,23 +83488,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -83664,23 +83924,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84092,23 +84360,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84517,23 +84793,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84946,23 +85230,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -85517,23 +85809,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -86005,23 +86305,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -86175,23 +86483,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -86604,23 +86920,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -86774,23 +87098,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -91547,9 +91879,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Article).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); @@ -91577,9 +91906,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Article).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); @@ -91613,9 +91939,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Article).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -91989,23 +92312,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quote\\", + [\\"https://w3id.org/fep/044f#quote\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -92438,23 +92769,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quoteAuthorization\\", + [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -93479,9 +93818,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Document).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#width\\", descriptor); @@ -93512,9 +93848,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Document).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#height\\", descriptor); @@ -93542,9 +93875,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Document).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; - }, }; descriptors.set(\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -96234,9 +96564,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CollectionPage).#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#partOf\\", descriptor); @@ -96268,9 +96595,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CollectionPage).#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#next\\", descriptor); @@ -96302,9 +96626,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CollectionPage).#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#prev\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -96677,23 +96998,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#partOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"partOf\\", + [\\"https://www.w3.org/ns/activitystreams#partOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#partOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -97101,23 +97430,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#next_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"next\\", + [\\"https://www.w3.org/ns/activitystreams#next\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#next_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -97526,23 +97863,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#prev_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"prev\\", + [\\"https://www.w3.org/ns/activitystreams#prev\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#prev_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -100529,9 +100874,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#proxyUrl\\", descriptor); @@ -100559,9 +100901,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\", descriptor); @@ -100589,9 +100928,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\", descriptor); @@ -100619,9 +100955,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#provideClientKey\\", descriptor); @@ -100649,9 +100982,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#signClientKey\\", descriptor); @@ -100679,9 +101009,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#sharedInbox\\", descriptor); @@ -100709,9 +101036,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#uploadMedia\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -105492,9 +105816,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -105526,9 +105847,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -105560,9 +105878,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -105590,9 +105905,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Group).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -105620,9 +105932,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -105658,9 +105967,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -105696,9 +106002,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -105730,9 +106033,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -105764,9 +106064,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -105798,9 +106095,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -105832,9 +106126,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -105866,9 +106157,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -105900,9 +106188,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -105934,9 +106219,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -105968,9 +106250,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -105998,9 +106277,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -106028,9 +106304,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -106058,9 +106331,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -106088,9 +106358,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -106118,9 +106385,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -106168,9 +106432,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -106218,9 +106479,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -106252,9 +106510,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -106282,9 +106537,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -106312,9 +106564,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -106342,9 +106591,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -106738,23 +106984,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -106904,23 +107158,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -107333,23 +107595,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -107503,23 +107773,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -108002,23 +108280,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -108451,23 +108737,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -108880,23 +109174,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -109312,23 +109614,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -109742,23 +110052,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -110170,23 +110488,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -110598,23 +110924,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -111023,23 +111357,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -111452,23 +111794,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -112023,23 +112373,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -112511,23 +112869,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -112681,23 +113047,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -113110,23 +113484,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -113280,23 +113662,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -117546,9 +117936,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#href\\", descriptor); @@ -117576,9 +117963,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#rel\\", descriptor); @@ -117606,9 +117990,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); @@ -117636,9 +118017,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; - }, }; descriptors.set(\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", descriptor); @@ -117669,9 +118047,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); @@ -117699,9 +118074,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#hreflang\\", descriptor); @@ -117732,9 +118104,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#height\\", descriptor); @@ -117765,9 +118134,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#width\\", descriptor); @@ -117803,9 +118169,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preview\\", descriptor); @@ -117833,9 +118196,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; - }, }; descriptors.set(\\"http://purl.org/dc/terms/license\\", descriptor); descriptors.set(\\"https://schema.org/license\\", descriptor); @@ -118372,23 +118732,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#preview_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"preview\\", + [\\"https://www.w3.org/ns/activitystreams#preview\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#preview_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -125392,9 +125760,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Note).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); @@ -125422,9 +125787,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Note).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); @@ -125458,9 +125820,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Note).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -125834,23 +126193,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quote\\", + [\\"https://w3id.org/fep/044f#quote\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -126283,23 +126650,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quoteAuthorization\\", + [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -127395,9 +127770,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as OrderedCollectionPage).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); @@ -127428,9 +127800,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as OrderedCollectionPage).#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#startIndex\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -127822,23 +128191,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#item_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"orderedItems\\", + [\\"https://www.w3.org/ns/activitystreams#items\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#item_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -130572,9 +130949,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -130606,9 +130980,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -130640,9 +131011,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -130670,9 +131038,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -130700,9 +131065,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -130738,9 +131100,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -130776,9 +131135,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -130810,9 +131166,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -130844,9 +131197,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -130878,9 +131228,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -130912,9 +131259,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -130946,9 +131290,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -130980,9 +131321,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -131014,9 +131352,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -131048,9 +131383,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -131078,9 +131410,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -131108,9 +131437,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -131138,9 +131464,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -131168,9 +131491,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -131198,9 +131518,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -131248,9 +131565,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -131298,9 +131612,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -131332,9 +131643,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -131362,9 +131670,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -131392,9 +131697,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -131422,9 +131724,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -131818,23 +132117,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -131984,23 +132291,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132413,23 +132728,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132583,23 +132906,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133082,23 +133413,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133531,23 +133870,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133960,23 +134307,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -134392,23 +134747,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -134822,23 +135185,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -135250,23 +135621,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -135678,23 +136057,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136103,23 +136490,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136532,23 +136927,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137103,23 +137506,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137591,23 +138002,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137761,23 +138180,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138190,23 +138617,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138360,23 +138795,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -144303,9 +144746,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -144337,9 +144777,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -144371,9 +144808,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -144401,9 +144835,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Person).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -144431,9 +144862,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -144469,9 +144897,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -144507,9 +144932,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -144541,9 +144963,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -144575,9 +144994,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -144609,9 +145025,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -144643,9 +145056,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -144677,9 +145087,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -144711,9 +145118,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -144745,9 +145149,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -144779,9 +145180,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -144809,9 +145207,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -144839,9 +145234,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -144869,9 +145261,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -144899,9 +145288,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -144929,9 +145315,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -144979,9 +145362,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -145029,9 +145409,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -145063,9 +145440,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -145093,9 +145467,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -145123,9 +145494,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -145153,9 +145521,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -145549,23 +145914,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -145715,23 +146088,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146144,23 +146525,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146314,23 +146703,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146813,23 +147210,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -147262,23 +147667,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -147691,23 +148104,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -148123,23 +148544,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -148553,23 +148982,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -148981,23 +149418,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -149409,23 +149854,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -149834,23 +150287,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150263,23 +150724,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150834,23 +151303,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -151322,23 +151799,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -151492,23 +151977,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -151921,23 +152414,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -152091,23 +152592,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -155810,9 +156319,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#accuracy\\", descriptor); @@ -155843,9 +156349,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#altitude\\", descriptor); @@ -155876,9 +156379,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#latitude\\", descriptor); @@ -155909,9 +156409,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#longitude\\", descriptor); @@ -155942,9 +156439,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#radius\\", descriptor); @@ -155972,9 +156466,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#units\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -157239,9 +157730,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Profile).#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#describes\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -157614,23 +158102,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#describes_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"describes\\", + [\\"https://www.w3.org/ns/activitystreams#describes\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#describes_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -158823,9 +159319,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#oneOf\\", descriptor); @@ -158857,9 +159350,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#anyOf\\", descriptor); @@ -158890,9 +159380,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#closed\\", descriptor); @@ -158923,9 +159410,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#votersCount\\", descriptor); @@ -158957,9 +159441,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); @@ -158987,9 +159468,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); @@ -159023,9 +159501,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -159403,23 +159878,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#exclusiveOption_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"oneOf\\", + [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#exclusiveOption_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -159835,23 +160318,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#inclusiveOption_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"anyOf\\", + [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inclusiveOption_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160293,23 +160784,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quote\\", + [\\"https://w3id.org/fep/044f#quote\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160742,23 +161241,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quoteAuthorization\\", + [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -163416,9 +163923,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Relationship).#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#subject\\", descriptor); @@ -163450,9 +163954,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Relationship).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#object\\", descriptor); @@ -163484,9 +163985,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Relationship).#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#relationship\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -163861,23 +164359,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#subject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"subject\\", + [\\"https://www.w3.org/ns/activitystreams#subject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#subject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -164286,23 +164792,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#object_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"object\\", + [\\"https://www.w3.org/ns/activitystreams#object\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -164453,23 +164967,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#object_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"object\\", + [\\"https://www.w3.org/ns/activitystreams#object\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -164881,23 +165403,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#relationship_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"relationship\\", + [\\"https://www.w3.org/ns/activitystreams#relationship\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#relationship_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -165050,23 +165580,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#relationship_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"relationship\\", + [\\"https://www.w3.org/ns/activitystreams#relationship\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#relationship_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -168447,9 +168985,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -168481,9 +169016,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -168515,9 +169047,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -168545,9 +169074,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Service).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -168575,9 +169101,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -168613,9 +169136,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -168651,9 +169171,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -168685,9 +169202,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -168719,9 +169233,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -168753,9 +169264,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -168787,9 +169295,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -168821,9 +169326,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -168855,9 +169357,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -168889,9 +169388,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -168923,9 +169419,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -168953,9 +169446,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -168983,9 +169473,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -169013,9 +169500,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -169043,9 +169527,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -169073,9 +169554,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -169123,9 +169601,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -169173,9 +169648,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -169207,9 +169679,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -169237,9 +169706,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -169267,9 +169733,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -169297,9 +169760,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -169693,23 +170153,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -169859,23 +170327,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -170288,23 +170764,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -170458,23 +170942,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -170957,23 +171449,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -171406,23 +171906,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -171835,23 +172343,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -172267,23 +172783,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -172697,23 +173221,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -173125,23 +173657,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -173553,23 +174093,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -173978,23 +174526,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -174407,23 +174963,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -174978,23 +175542,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -175466,23 +176038,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -175636,23 +176216,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -176065,23 +176653,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -176235,23 +176831,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -179996,9 +180600,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Source).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#content\\", descriptor); @@ -180026,9 +180627,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Source).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -182032,9 +182630,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Tombstone).#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#formerType\\", descriptor); @@ -182065,9 +182660,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Tombstone).#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#deleted\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index a77485927..7de23ca59 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -387,7 +387,6 @@ type RawPropertyEncoder = ( interface RawPropertyDescriptor { readonly canonicalIri: string; readonly encode: RawPropertyEncoder; - readonly values: (object: object) => readonly unknown[]; } // Unknown properties retained while decoding, keyed by the decoded object: @@ -419,97 +418,88 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } -function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { - if ( - source == null || destination == null || - typeof source !== \\"object\\" || typeof destination !== \\"object\\" || - !(RAW_PROPERTY_PROTOCOL in source) || !(RAW_PROPERTY_PROTOCOL in destination) - ) { - return false; - } - const sourceId = (source as unknown as { id: URL | null }).id; - const destinationId = (destination as unknown as { id: URL | null }).id; - return sourceId?.href === destinationId?.href; +// Embeds the context of a cached document in a document embedded in it, so +// that decoding the embedded document alone resolves its terms the same way +// as decoding the whole document did. Entries that the embedded document's +// own context repeats are left out, since applying them again later yields +// the same terms. Property-scoped contexts of the parent are not applied, as +// the embedded document is decoded as a top-level node: +function inheritJsonLdContext( + parentContext: unknown, + document: object, +): object { + const own = (document as { \\"@context\\"?: unknown })[\\"@context\\"]; + const ownEntries = globalThis.Array.isArray(own) ? own : [own]; + const ownKeys = new Set( + ownEntries.map((entry) => globalThis.JSON.stringify(entry)), + ); + const context = [ + ...(globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]).filter((entry) => + !ownKeys.has(globalThis.JSON.stringify(entry)) + ), + ...ownEntries, + ]; + return { + ...document, + \\"@context\\": context.length === 1 ? context[0] : context, + }; } -function getRawPropertyDescriptors(object: object): Set { - const descriptors = new Set(); - let prototype: object | null = globalThis.Object.getPrototypeOf(object); - while (prototype != null) { - for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { - descriptors.add(descriptor); - } - prototype = globalThis.Object.getPrototypeOf(prototype); - } - return descriptors; -} +// The property IRIs each key of a compacted document expands to, keyed by +// the document: +const expandedKeys = new WeakMap>>(); -// Merges the retained unknown properties of a decoded object into a copy that -// was decoded again by a different class. The classes classify properties -// differently, so the copy keeps what it retained itself and gains the -// original's values for the properties its own class does not know either: -function mergeRawProperties(source: object, destination: object): void { - const retained = retainedRawProperties.get(source); - if (retained == null) return; - const merged: Record = { - ...retainedRawProperties.get(destination), - }; - let changed = false; - for (const [iri, values] of globalThis.Object.entries(retained)) { - if (getRawPropertyDescriptor(destination, iri) != null) continue; - merged[iri] = values; - changed = true; - } - if (changed) { - retainedRawProperties.set( - destination, - globalThis.Object.freeze(merged) as RetainedRawProperties, - ); - } +function expandKey( + document: Record, + key: string, + contextLoader: DocumentLoader, +): Promise { + let keys = expandedKeys.get(document); + if (keys == null) { + keys = new Map(); + expandedKeys.set(document, keys); + } + const cached = keys.get(key); + if (cached != null) return cached; + const iris = jsonld.expand( + { \\"@context\\": document[\\"@context\\"], [key]: [] }, + { documentLoader: contextLoader, keepFreeFloatingNodes: true }, + ).then((expanded: unknown[]) => + globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => + !iri.startsWith(\\"@\\") + ) + ); + // A failure, such as of the context loader, is not remembered, as another + // call can pass another loader: + const map = keys; + iris.catch(() => map.delete(key)); + keys.set(key, iris); + return iris; } -// Copies the retained unknown properties of a decoded object and of the -// objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. Only objects with the same -// id are paired. When the decoding dropped some values of a property, -// positions no longer correspond, so nested objects are paired by id alone. -// When the copy was decoded by a different class, the retained properties are -// merged rather than replaced, and only the properties both classes declare, -// matched by their IRIs, are followed: -function copyRawPropertiesDeep( - source: object, - destination: object, - visited: Set = new Set(), -): void { - if (visited.has(destination)) return; - visited.add(destination); - if (!isSameRawPropertyNode(source, destination)) return; - const sameClass = globalThis.Object.getPrototypeOf(source) === - globalThis.Object.getPrototypeOf(destination); - if (sameClass) copyRawProperties(source, destination); - else mergeRawProperties(source, destination); - for (const descriptor of getRawPropertyDescriptors(destination)) { - // Sibling classes declare the same property with distinct descriptors, so - // each object is read through its own class's descriptor: - const sourceDescriptor = sameClass - ? descriptor - : getRawPropertyDescriptor(source, descriptor.canonicalIri); - if (sourceDescriptor == null) continue; - const sources = sourceDescriptor.values(source); - const destinations = descriptor.values(destination); - const aligned = sources.length === destinations.length; - for (let i = 0; i < destinations.length; i++) { - const destination = destinations[i]; - const source = aligned - ? sources[i] - : (destination as { id?: URL | null } | null)?.id == null - ? undefined - : sources.find((s) => isSameRawPropertyNode(s, destination)); - if (source !== destination && isSameRawPropertyNode(source, destination)) { - copyRawPropertiesDeep(source as object, destination as object, visited); - } - } - } +// Whether a compacted document maps the given key, and no other key, to +// a property, so that the embedded documents under the key are the values +// decoded for the property. A context can remap the key to another property +// or map another term to the property, in which case the cached documents +// cannot be matched with the decoded values: +async function isCachedPropertyKey( + document: Record, + key: string, + iris: readonly string[], + contextLoader: DocumentLoader, +): Promise { + const own = await expandKey(document, key, contextLoader); + if (own.length !== 1 || own[0] !== iris[0]) return false; + const others = await globalThis.Promise.all( + globalThis.Object.keys(document) + .filter((k) => k !== key && !k.startsWith(\\"@\\")) + // Keyword aliases, such as id, cannot take an empty array, and are + // not properties anyway: + .map((k) => expandKey(document, k, contextLoader).catch(() => [])), + ); + return !others.flat().some((iri) => iris.includes(iri)); } async function readRawProperty( @@ -4818,9 +4808,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#attachment\\", descriptor); @@ -4868,9 +4855,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#attributedTo\\", descriptor); @@ -4902,9 +4886,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#audience\\", descriptor); @@ -4935,9 +4916,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#content\\", descriptor); @@ -4973,9 +4951,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3mhZzGXSpQ431mBSz2kvych22v4e_context; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#context\\", descriptor); @@ -5006,9 +4981,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); @@ -5039,9 +5011,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endTime\\", descriptor); @@ -5077,9 +5046,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#generator\\", descriptor); @@ -5111,9 +5077,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#icon\\", descriptor); @@ -5145,9 +5108,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#image\\", descriptor); @@ -5183,9 +5143,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#inReplyTo\\", descriptor); @@ -5221,9 +5178,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#location\\", descriptor); @@ -5259,9 +5213,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preview\\", descriptor); @@ -5292,9 +5243,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_5e258TDXtuhaFRPZiGoDfEpjdMr_published; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#published\\", descriptor); @@ -5326,9 +5274,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_7UpwM3JWcXhADcscukEehBorf6k_replies; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#replies\\", descriptor); @@ -5360,9 +5305,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3kAfck9PcEYt2L7xug5y99YPbANs_shares; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#shares\\", descriptor); @@ -5394,9 +5336,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#likes\\", descriptor); @@ -5428,9 +5367,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions; - }, }; descriptors.set(\\"http://fedibird.com/ns#emojiReactions\\", descriptor); @@ -5461,9 +5397,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2w3Jmue4up8iVDUA51WZqomEF438_startTime; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#startTime\\", descriptor); @@ -5494,9 +5427,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#summary\\", descriptor); @@ -5532,9 +5462,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_5chuqj6s95p5gg2sk1HntGfarRf_tag; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#tag\\", descriptor); @@ -5565,9 +5492,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#updated\\", descriptor); @@ -5599,9 +5523,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#url\\", descriptor); @@ -5633,9 +5554,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#to\\", descriptor); @@ -5667,9 +5585,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#bto\\", descriptor); @@ -5701,9 +5616,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#cc\\", descriptor); @@ -5735,9 +5647,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#bcc\\", descriptor); @@ -5765,9 +5674,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); @@ -5798,9 +5704,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#duration\\", descriptor); @@ -5828,9 +5731,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#sensitive\\", descriptor); @@ -5862,9 +5762,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#source\\", descriptor); @@ -5896,9 +5793,6 @@ array.push({ \\"@graph\\": element }); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; - }, }; descriptors.set(\\"https://w3id.org/security#proof\\", descriptor); @@ -5930,9 +5824,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionPolicy\\", descriptor); @@ -5960,9 +5851,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; - }, }; descriptors.set(\\"https://gotosocial.org/ns#approvedBy\\", descriptor); @@ -5994,9 +5882,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; - }, }; descriptors.set(\\"https://gotosocial.org/ns#likeAuthorization\\", descriptor); @@ -6028,9 +5913,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; - }, }; descriptors.set(\\"https://gotosocial.org/ns#replyAuthorization\\", descriptor); @@ -6062,9 +5944,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization; - }, }; descriptors.set(\\"https://gotosocial.org/ns#announceAuthorization\\", descriptor); @@ -6096,9 +5975,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations; - }, }; descriptors.set(\\"https://w3id.org/fep/22cd#translations\\", descriptor); @@ -6126,9 +6002,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; - }, }; descriptors.set(\\"http://purl.org/dc/terms/license\\", descriptor); descriptors.set(\\"https://schema.org/license\\", descriptor); @@ -6538,23 +6411,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#attachment_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"attachment\\", + [\\"https://www.w3.org/ns/activitystreams#attachment\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#attachment_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7026,23 +6907,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#attribution_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"attributedTo\\", + [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#attribution_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7195,23 +7084,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#attribution_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"attributedTo\\", + [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#attribution_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7622,23 +7519,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#audience_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"audience\\", + [\\"https://www.w3.org/ns/activitystreams#audience\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#audience_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -7790,23 +7695,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#audience_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"audience\\", + [\\"https://www.w3.org/ns/activitystreams#audience\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#audience_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8270,23 +8183,31 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#context_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"context\\", + [\\"https://www.w3.org/ns/activitystreams#context\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#context_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -8757,23 +8678,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#generator_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"generator\\", + [\\"https://www.w3.org/ns/activitystreams#generator\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#generator_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9207,23 +9136,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#icon_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"icon\\", + [\\"https://www.w3.org/ns/activitystreams#icon\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#icon_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9376,23 +9313,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#icon_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"icon\\", + [\\"https://www.w3.org/ns/activitystreams#icon\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#icon_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9826,23 +9771,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#image_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"image\\", + [\\"https://www.w3.org/ns/activitystreams#image\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#image_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -9995,23 +9948,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#image_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"image\\", + [\\"https://www.w3.org/ns/activitystreams#image\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#image_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10437,23 +10398,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#replyTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inReplyTo\\", + [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replyTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -10605,23 +10574,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#replyTarget_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inReplyTo\\", + [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replyTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11047,23 +11024,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#location_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"location\\", + [\\"https://www.w3.org/ns/activitystreams#location\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#location_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11215,23 +11200,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#location_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"location\\", + [\\"https://www.w3.org/ns/activitystreams#location\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#location_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11656,23 +11649,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#preview_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"preview\\", + [\\"https://www.w3.org/ns/activitystreams#preview\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#preview_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -11823,23 +11824,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#preview_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"preview\\", + [\\"https://www.w3.org/ns/activitystreams#preview\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#preview_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12263,23 +12272,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#replies_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"replies\\", + [\\"https://www.w3.org/ns/activitystreams#replies\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replies_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -12695,23 +12712,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#shares_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"shares\\", + [\\"https://www.w3.org/ns/activitystreams#shares\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#shares_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13127,23 +13152,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#likes_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"likes\\", + [\\"https://www.w3.org/ns/activitystreams#likes\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likes_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -13553,23 +13586,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#emojiReactions_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"emojiReactions\\", + [\\"http://fedibird.com/ns#emojiReactions\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#emojiReactions_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14040,23 +14081,31 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#tag_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"tag\\", + [\\"https://www.w3.org/ns/activitystreams#tag\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#tag_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14501,23 +14550,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#to_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"to\\", + [\\"https://www.w3.org/ns/activitystreams#to\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#to_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -14669,23 +14726,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#to_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"to\\", + [\\"https://www.w3.org/ns/activitystreams#to\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#to_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15096,23 +15161,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#bto_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"bto\\", + [\\"https://www.w3.org/ns/activitystreams#bto\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bto_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15264,23 +15337,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#bto_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"bto\\", + [\\"https://www.w3.org/ns/activitystreams#bto\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bto_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15691,23 +15772,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#cc_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"cc\\", + [\\"https://www.w3.org/ns/activitystreams#cc\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#cc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -15859,23 +15948,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#cc_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"cc\\", + [\\"https://www.w3.org/ns/activitystreams#cc\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#cc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16286,23 +16383,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#bcc_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"bcc\\", + [\\"https://www.w3.org/ns/activitystreams#bcc\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bcc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16454,23 +16559,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#bcc_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"bcc\\", + [\\"https://www.w3.org/ns/activitystreams#bcc\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bcc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -16944,23 +17057,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#proof_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"proof\\", + [\\"https://w3id.org/security#proof\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#proof_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -17111,23 +17232,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#proof_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"proof\\", + [\\"https://w3id.org/security#proof\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#proof_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -17577,23 +17706,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#likeAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"likeAuthorization\\", + [\\"https://gotosocial.org/ns#likeAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likeAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -18003,23 +18140,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#replyAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"replyAuthorization\\", + [\\"https://gotosocial.org/ns#replyAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replyAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -18429,23 +18574,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#announceAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"announceAuthorization\\", + [\\"https://gotosocial.org/ns#announceAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#announceAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -24549,9 +24702,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ChatMessage).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); @@ -24579,9 +24729,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ChatMessage).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); @@ -24615,9 +24762,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ChatMessage).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -24991,23 +25135,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quote\\", + [\\"https://w3id.org/fep/044f#quote\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -25440,23 +25592,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quoteAuthorization\\", + [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -27369,9 +27529,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#actor\\", descriptor); @@ -27403,9 +27560,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#object\\", descriptor); @@ -27437,9 +27591,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#target\\", descriptor); @@ -27471,9 +27622,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#result\\", descriptor); @@ -27505,9 +27653,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_25zu2s3VxVujgEKqrDycjE284XQR_origin; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#origin\\", descriptor); @@ -27539,9 +27684,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#instrument\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -27975,23 +28117,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#actor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"actor\\", + [\\"https://www.w3.org/ns/activitystreams#actor\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#actor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28144,23 +28294,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#actor_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"actor\\", + [\\"https://www.w3.org/ns/activitystreams#actor\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#actor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28572,23 +28730,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#object_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"object\\", + [\\"https://www.w3.org/ns/activitystreams#object\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -28741,23 +28907,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#object_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"object\\", + [\\"https://www.w3.org/ns/activitystreams#object\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -29172,23 +29346,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#target_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"target\\", + [\\"https://www.w3.org/ns/activitystreams#target\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#target_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -29344,23 +29526,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#target_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"target\\", + [\\"https://www.w3.org/ns/activitystreams#target\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#target_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -29772,23 +29962,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#result_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"result\\", + [\\"https://www.w3.org/ns/activitystreams#result\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#result_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -29941,23 +30139,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#result_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"result\\", + [\\"https://www.w3.org/ns/activitystreams#result\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#result_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -30370,23 +30576,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#origin_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"origin\\", + [\\"https://www.w3.org/ns/activitystreams#origin\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#origin_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -30540,23 +30754,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#origin_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"origin\\", + [\\"https://www.w3.org/ns/activitystreams#origin\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#origin_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -30967,23 +31189,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#instrument_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"instrument\\", + [\\"https://www.w3.org/ns/activitystreams#instrument\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#instrument_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -31135,23 +31365,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#instrument_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"instrument\\", + [\\"https://www.w3.org/ns/activitystreams#instrument\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#instrument_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -33198,9 +33436,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as PropertyValue).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); @@ -33231,9 +33466,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as PropertyValue).#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value; - }, }; descriptors.set(\\"http://schema.org#value\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -34157,9 +34389,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Measure).#_27fgyFbosTtMAhuepJH8K3ZGURT6; - }, }; descriptors.set(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\", descriptor); @@ -34190,9 +34419,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Measure).#_1GQx8o2RgxRs4x9G5uT39XYBv7D; - }, }; descriptors.set(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -35079,9 +35305,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as AnnounceAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -35113,9 +35336,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as AnnounceAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -35488,23 +35708,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -35913,23 +36141,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -37653,9 +37889,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#canFeature\\", descriptor); @@ -37687,9 +37920,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike; - }, }; descriptors.set(\\"https://gotosocial.org/ns#canLike\\", descriptor); @@ -37721,9 +37951,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply; - }, }; descriptors.set(\\"https://gotosocial.org/ns#canReply\\", descriptor); @@ -37755,9 +37982,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce; - }, }; descriptors.set(\\"https://gotosocial.org/ns#canAnnounce\\", descriptor); @@ -37789,9 +38013,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; - }, }; descriptors.set(\\"https://gotosocial.org/ns#canQuote\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -39250,9 +39471,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionRule).#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval; - }, }; descriptors.set(\\"https://gotosocial.org/ns#automaticApproval\\", descriptor); @@ -39280,9 +39498,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionRule).#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; - }, }; descriptors.set(\\"https://gotosocial.org/ns#manualApproval\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -40149,9 +40364,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as LikeAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -40183,9 +40395,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as LikeAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -40558,23 +40767,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -40983,23 +41200,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -42501,9 +42726,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ReplyAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -42535,9 +42757,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ReplyAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -42910,23 +43129,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -43335,23 +43562,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -44853,9 +45088,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as QuoteAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -44887,9 +45119,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as QuoteAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -45261,23 +45490,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -45686,23 +45923,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -47631,9 +47876,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_diXuPmFWiEqfLPhhrxg6Xc7ixZG; - }, }; descriptors.set(\\"https://schema.org/inLanguage\\", descriptor); @@ -47681,9 +47923,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; - }, }; descriptors.set(\\"https://schema.org/translator\\", descriptor); @@ -47711,9 +47950,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_Msz9PwRg7cWkiXPL4ixyQLtuuH7; - }, }; descriptors.set(\\"https://schema.org/translationOfWork\\", descriptor); @@ -47744,9 +47980,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated; - }, }; descriptors.set(\\"https://w3id.org/fep/22cd#sourceUpdated\\", descriptor); @@ -47774,9 +48007,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_4KvkQNz1JjGs8S7iJDcGrUYETbUW; - }, }; descriptors.set(\\"https://schema.org/isBasedOn\\", descriptor); @@ -47808,9 +48038,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#url\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -48262,23 +48489,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#translator_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"translator\\", + [\\"https://schema.org/translator\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#translator_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -48434,23 +48669,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#translator_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"translator\\", + [\\"https://schema.org/translator\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#translator_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -49886,9 +50129,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeatureAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactingObject\\", descriptor); @@ -49920,9 +50160,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeatureAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set(\\"https://gotosocial.org/ns#interactionTarget\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -50293,23 +50530,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactingObject\\", + [\\"https://gotosocial.org/ns#interactingObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -50717,23 +50962,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"interactionTarget\\", + [\\"https://gotosocial.org/ns#interactionTarget\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -52862,9 +53115,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#totalItems\\", descriptor); @@ -52896,9 +53146,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_3UyUdxnyn6cDn53QKrh4MBiearma_current; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#current\\", descriptor); @@ -52930,9 +53177,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_J52RqweMe6hhv7RnLJMC8BExTE5_first; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#first\\", descriptor); @@ -52964,9 +53208,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#last\\", descriptor); @@ -53002,9 +53243,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); @@ -53036,9 +53274,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#likesOf\\", descriptor); @@ -53070,9 +53305,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#sharesOf\\", descriptor); @@ -53104,9 +53336,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#repliesOf\\", descriptor); @@ -53138,9 +53367,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#inboxOf\\", descriptor); @@ -53172,9 +53398,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#outboxOf\\", descriptor); @@ -53206,9 +53429,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#followersOf\\", descriptor); @@ -53240,9 +53460,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#followingOf\\", descriptor); @@ -53274,9 +53491,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; - }, }; descriptors.set(\\"https://w3id.org/fep/5711#likedOf\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -53665,23 +53879,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#current_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"current\\", + [\\"https://www.w3.org/ns/activitystreams#current\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#current_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -54091,23 +54313,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#first_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"first\\", + [\\"https://www.w3.org/ns/activitystreams#first\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#first_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -54517,23 +54747,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#last_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"last\\", + [\\"https://www.w3.org/ns/activitystreams#last\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#last_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -54962,23 +55200,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#item_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"items\\", + [\\"https://www.w3.org/ns/activitystreams#items\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#item_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -55388,23 +55634,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#likesOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"likesOf\\", + [\\"https://w3id.org/fep/5711#likesOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likesOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -55813,23 +56067,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#sharesOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"sharesOf\\", + [\\"https://w3id.org/fep/5711#sharesOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#sharesOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -56238,23 +56500,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#repliesOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"repliesOf\\", + [\\"https://w3id.org/fep/5711#repliesOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#repliesOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -56663,23 +56933,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inboxOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inboxOf\\", + [\\"https://w3id.org/fep/5711#inboxOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inboxOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -57088,23 +57366,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outboxOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outboxOf\\", + [\\"https://w3id.org/fep/5711#outboxOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outboxOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -57513,23 +57799,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followersOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followersOf\\", + [\\"https://w3id.org/fep/5711#followersOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followersOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -57938,23 +58232,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followingOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followingOf\\", + [\\"https://w3id.org/fep/5711#followingOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followingOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -58363,23 +58665,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#likedOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"likedOf\\", + [\\"https://w3id.org/fep/5711#likedOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likedOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -60573,9 +60883,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as OrderedCollection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -60967,23 +61274,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#item_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"orderedItems\\", + [\\"https://www.w3.org/ns/activitystreams#items\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#item_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -61817,9 +62132,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedCollection).#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#topic\\", descriptor); @@ -61847,9 +62159,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedCollection).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -62762,9 +63071,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedItem).#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredObject\\", descriptor); @@ -62796,9 +63102,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedItem).#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featureAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -63169,23 +63472,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredObject\\", + [\\"https://w3id.org/fep/7aa9#featuredObject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -63595,23 +63906,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featureAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featureAuthorization\\", + [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featureAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -64680,9 +64999,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DidService).#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#serviceEndpoint\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -66068,9 +66384,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite; - }, }; descriptors.set(\\"https://w3id.org/security#cryptosuite\\", descriptor); @@ -66102,9 +66415,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod; - }, }; descriptors.set(\\"https://w3id.org/security#verificationMethod\\", descriptor); @@ -66134,9 +66444,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose; - }, }; descriptors.set(\\"https://w3id.org/security#proofPurpose\\", descriptor); @@ -66167,9 +66474,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue; - }, }; descriptors.set(\\"https://w3id.org/security#proofValue\\", descriptor); @@ -66200,9 +66504,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_3qzP3ukEZoUziK5FEiA1RhU4aqac; - }, }; descriptors.set(\\"http://purl.org/dc/terms/created\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -67770,9 +68071,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CryptographicKey).#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner; - }, }; descriptors.set(\\"https://w3id.org/security#owner\\", descriptor); @@ -67800,9 +68098,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CryptographicKey).#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem; - }, }; descriptors.set(\\"https://w3id.org/security#publicKeyPem\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -68233,23 +68528,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#owner_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"owner\\", + [\\"https://w3id.org/security#owner\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#owner_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -69318,9 +69621,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Multikey).#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller; - }, }; descriptors.set(\\"https://w3id.org/security#controller\\", descriptor); @@ -69351,9 +69651,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Multikey).#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase; - }, }; descriptors.set(\\"https://w3id.org/security#publicKeyMultibase\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -69784,23 +70081,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#controller_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"controller\\", + [\\"https://w3id.org/security#controller\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#controller_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -70797,9 +71102,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Agreement).#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#stipulates\\", descriptor); @@ -70831,9 +71133,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Agreement).#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#stipulatesReciprocal\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -71832,9 +72131,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Commitment).#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#satisfies\\", descriptor); @@ -71866,9 +72162,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Commitment).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -72960,9 +73253,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#action\\", descriptor); @@ -72990,9 +73280,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\", descriptor); @@ -73024,9 +73311,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\", descriptor); @@ -73058,9 +73342,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#availableQuantity\\", descriptor); @@ -73092,9 +73373,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -74370,9 +74648,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#purpose\\", descriptor); @@ -74404,9 +74679,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#publishes\\", descriptor); @@ -74438,9 +74710,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#reciprocal\\", descriptor); @@ -74468,9 +74737,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased; - }, }; descriptors.set(\\"https://w3id.org/valueflows/ont/vf#unitBased\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -78984,9 +79250,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -79018,9 +79281,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -79052,9 +79312,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -79082,9 +79339,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Application).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -79112,9 +79366,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -79150,9 +79401,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -79188,9 +79436,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -79222,9 +79467,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -79256,9 +79498,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -79290,9 +79529,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -79324,9 +79560,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -79358,9 +79591,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -79392,9 +79622,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -79426,9 +79653,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -79460,9 +79684,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -79490,9 +79711,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -79520,9 +79738,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -79550,9 +79765,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -79580,9 +79792,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -79610,9 +79819,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -79660,9 +79866,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -79710,9 +79913,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -79744,9 +79944,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -79774,9 +79971,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -79804,9 +79998,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -79834,9 +80025,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -80230,23 +80418,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -80396,23 +80592,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -80825,23 +81029,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -80995,23 +81207,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -81494,23 +81714,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -81943,23 +82171,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -82372,23 +82608,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -82804,23 +83048,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -83234,23 +83486,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -83662,23 +83922,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84090,23 +84358,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84515,23 +84791,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -84944,23 +85228,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -85515,23 +85807,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -86003,23 +86303,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -86173,23 +86481,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -86602,23 +86918,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -86772,23 +87096,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -91545,9 +91877,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Article).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); @@ -91575,9 +91904,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Article).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); @@ -91611,9 +91937,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Article).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -91987,23 +92310,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quote\\", + [\\"https://w3id.org/fep/044f#quote\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -92436,23 +92767,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quoteAuthorization\\", + [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -93477,9 +93816,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Document).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#width\\", descriptor); @@ -93510,9 +93846,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Document).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#height\\", descriptor); @@ -93540,9 +93873,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Document).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; - }, }; descriptors.set(\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -96232,9 +96562,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CollectionPage).#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#partOf\\", descriptor); @@ -96266,9 +96593,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CollectionPage).#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#next\\", descriptor); @@ -96300,9 +96624,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CollectionPage).#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#prev\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -96675,23 +96996,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#partOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"partOf\\", + [\\"https://www.w3.org/ns/activitystreams#partOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#partOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -97099,23 +97428,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#next_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"next\\", + [\\"https://www.w3.org/ns/activitystreams#next\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#next_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -97524,23 +97861,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#prev_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"prev\\", + [\\"https://www.w3.org/ns/activitystreams#prev\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#prev_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -100527,9 +100872,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#proxyUrl\\", descriptor); @@ -100557,9 +100899,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\", descriptor); @@ -100587,9 +100926,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\", descriptor); @@ -100617,9 +100953,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#provideClientKey\\", descriptor); @@ -100647,9 +100980,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#signClientKey\\", descriptor); @@ -100677,9 +101007,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#sharedInbox\\", descriptor); @@ -100707,9 +101034,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#uploadMedia\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -105490,9 +105814,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -105524,9 +105845,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -105558,9 +105876,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -105588,9 +105903,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Group).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -105618,9 +105930,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -105656,9 +105965,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -105694,9 +106000,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -105728,9 +106031,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -105762,9 +106062,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -105796,9 +106093,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -105830,9 +106124,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -105864,9 +106155,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -105898,9 +106186,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -105932,9 +106217,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -105966,9 +106248,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -105996,9 +106275,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -106026,9 +106302,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -106056,9 +106329,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -106086,9 +106356,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -106116,9 +106383,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -106166,9 +106430,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -106216,9 +106477,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -106250,9 +106508,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -106280,9 +106535,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -106310,9 +106562,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -106340,9 +106589,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -106736,23 +106982,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -106902,23 +107156,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -107331,23 +107593,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -107501,23 +107771,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -108000,23 +108278,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -108449,23 +108735,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -108878,23 +109172,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -109310,23 +109612,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -109740,23 +110050,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -110168,23 +110486,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -110596,23 +110922,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -111021,23 +111355,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -111450,23 +111792,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -112021,23 +112371,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -112509,23 +112867,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -112679,23 +113045,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -113108,23 +113482,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -113278,23 +113660,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -117544,9 +117934,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#href\\", descriptor); @@ -117574,9 +117961,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#rel\\", descriptor); @@ -117604,9 +117988,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); @@ -117634,9 +118015,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; - }, }; descriptors.set(\\"https://www.w3.org/ns/credentials/v2#digestMultibase\\", descriptor); @@ -117667,9 +118045,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#name\\", descriptor); @@ -117697,9 +118072,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#hreflang\\", descriptor); @@ -117730,9 +118102,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#height\\", descriptor); @@ -117763,9 +118132,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#width\\", descriptor); @@ -117801,9 +118167,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preview\\", descriptor); @@ -117831,9 +118194,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; - }, }; descriptors.set(\\"http://purl.org/dc/terms/license\\", descriptor); descriptors.set(\\"https://schema.org/license\\", descriptor); @@ -118370,23 +118730,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#preview_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"preview\\", + [\\"https://www.w3.org/ns/activitystreams#preview\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#preview_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -125390,9 +125758,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Note).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); @@ -125420,9 +125785,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Note).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); @@ -125456,9 +125818,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Note).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -125832,23 +126191,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quote\\", + [\\"https://w3id.org/fep/044f#quote\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -126281,23 +126648,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quoteAuthorization\\", + [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -127393,9 +127768,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as OrderedCollectionPage).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#items\\", descriptor); @@ -127426,9 +127798,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as OrderedCollectionPage).#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#startIndex\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -127820,23 +128189,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#item_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"orderedItems\\", + [\\"https://www.w3.org/ns/activitystreams#items\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#item_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -130570,9 +130947,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -130604,9 +130978,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -130638,9 +131009,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -130668,9 +131036,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -130698,9 +131063,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -130736,9 +131098,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -130774,9 +131133,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -130808,9 +131164,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -130842,9 +131195,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -130876,9 +131226,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -130910,9 +131257,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -130944,9 +131288,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -130978,9 +131319,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -131012,9 +131350,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -131046,9 +131381,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -131076,9 +131408,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -131106,9 +131435,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -131136,9 +131462,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -131166,9 +131489,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -131196,9 +131516,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -131246,9 +131563,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -131296,9 +131610,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -131330,9 +131641,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -131360,9 +131668,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -131390,9 +131695,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -131420,9 +131722,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -131816,23 +132115,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -131982,23 +132289,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132411,23 +132726,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -132581,23 +132904,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133080,23 +133411,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133529,23 +133868,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -133958,23 +134305,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -134390,23 +134745,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -134820,23 +135183,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -135248,23 +135619,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -135676,23 +136055,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136101,23 +136488,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -136530,23 +136925,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137101,23 +137504,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137589,23 +138000,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -137759,23 +138178,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138188,23 +138615,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -138358,23 +138793,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -144301,9 +144744,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -144335,9 +144775,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -144369,9 +144806,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -144399,9 +144833,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Person).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -144429,9 +144860,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -144467,9 +144895,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -144505,9 +144930,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -144539,9 +144961,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -144573,9 +144992,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -144607,9 +145023,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -144641,9 +145054,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -144675,9 +145085,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -144709,9 +145116,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -144743,9 +145147,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -144777,9 +145178,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -144807,9 +145205,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -144837,9 +145232,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -144867,9 +145259,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -144897,9 +145286,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -144927,9 +145313,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -144977,9 +145360,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -145027,9 +145407,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -145061,9 +145438,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -145091,9 +145465,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -145121,9 +145492,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -145151,9 +145519,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -145547,23 +145912,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -145713,23 +146086,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146142,23 +146523,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146312,23 +146701,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -146811,23 +147208,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -147260,23 +147665,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -147689,23 +148102,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -148121,23 +148542,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -148551,23 +148980,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -148979,23 +149416,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -149407,23 +149852,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -149832,23 +150285,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150261,23 +150722,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -150832,23 +151301,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -151320,23 +151797,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -151490,23 +151975,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -151919,23 +152412,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -152089,23 +152590,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -155808,9 +156317,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#accuracy\\", descriptor); @@ -155841,9 +156347,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#altitude\\", descriptor); @@ -155874,9 +156377,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#latitude\\", descriptor); @@ -155907,9 +156407,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#longitude\\", descriptor); @@ -155940,9 +156437,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#radius\\", descriptor); @@ -155970,9 +156464,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#units\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -157237,9 +157728,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Profile).#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#describes\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -157612,23 +158100,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#describes_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"describes\\", + [\\"https://www.w3.org/ns/activitystreams#describes\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#describes_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -158821,9 +159317,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#oneOf\\", descriptor); @@ -158855,9 +159348,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#anyOf\\", descriptor); @@ -158888,9 +159378,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#closed\\", descriptor); @@ -158921,9 +159408,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#votersCount\\", descriptor); @@ -158955,9 +159439,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quote\\", descriptor); @@ -158985,9 +159466,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#quoteUrl\\", descriptor); descriptors.set(\\"https://misskey-hub.net/ns#_misskey_quote\\", descriptor); @@ -159021,9 +159499,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set(\\"https://w3id.org/fep/044f#quoteAuthorization\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -159401,23 +159876,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#exclusiveOption_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"oneOf\\", + [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#exclusiveOption_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -159833,23 +160316,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#inclusiveOption_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"anyOf\\", + [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inclusiveOption_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160291,23 +160782,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quote\\", + [\\"https://w3id.org/fep/044f#quote\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -160740,23 +161239,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"quoteAuthorization\\", + [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -163414,9 +163921,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Relationship).#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#subject\\", descriptor); @@ -163448,9 +163952,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Relationship).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#object\\", descriptor); @@ -163482,9 +163983,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Relationship).#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#relationship\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -163859,23 +164357,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#subject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"subject\\", + [\\"https://www.w3.org/ns/activitystreams#subject\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#subject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -164284,23 +164790,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#object_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"object\\", + [\\"https://www.w3.org/ns/activitystreams#object\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -164451,23 +164965,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#object_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"object\\", + [\\"https://www.w3.org/ns/activitystreams#object\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -164879,23 +165401,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#relationship_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"relationship\\", + [\\"https://www.w3.org/ns/activitystreams#relationship\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#relationship_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -165048,23 +165578,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#relationship_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"relationship\\", + [\\"https://www.w3.org/ns/activitystreams#relationship\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#relationship_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -168445,9 +168983,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#preferredUsername\\", descriptor); @@ -168479,9 +169014,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set(\\"https://w3id.org/security#publicKey\\", descriptor); @@ -168513,9 +169045,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set(\\"https://w3id.org/security#assertionMethod\\", descriptor); @@ -168543,9 +169072,6 @@ array.push(element); if (array.length < 1) return undefined; return { \\"@list\\": array }; }, - values(object: object): readonly unknown[] { - return (object as Service).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set(\\"https://w3id.org/fep/ef61/gateways\\", descriptor); @@ -168573,9 +169099,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers\\", descriptor); @@ -168611,9 +169134,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set(\\"http://www.w3.org/ns/ldp#inbox\\", descriptor); @@ -168649,9 +169169,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#outbox\\", descriptor); @@ -168683,9 +169200,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#following\\", descriptor); @@ -168717,9 +169231,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#followers\\", descriptor); @@ -168751,9 +169262,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#liked\\", descriptor); @@ -168785,9 +169293,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featured\\", descriptor); @@ -168819,9 +169324,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#featuredTags\\", descriptor); @@ -168853,9 +169355,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set(\\"https://w3id.org/fep/7aa9#featuredCollections\\", descriptor); @@ -168887,9 +169386,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#streams\\", descriptor); @@ -168921,9 +169417,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#endpoints\\", descriptor); @@ -168951,9 +169444,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#discoverable\\", descriptor); @@ -168981,9 +169471,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#suspended\\", descriptor); @@ -169011,9 +169498,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#memorial\\", descriptor); @@ -169041,9 +169525,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#indexable\\", descriptor); @@ -169071,9 +169552,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set(\\"http://joinmastodon.org/ns#attributionDomains\\", descriptor); @@ -169121,9 +169599,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#movedTo\\", descriptor); @@ -169171,9 +169646,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\", descriptor); @@ -169205,9 +169677,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set(\\"https://www.w3.org/ns/did#service\\", descriptor); @@ -169235,9 +169704,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#_misskey_followedMessage\\", descriptor); @@ -169265,9 +169731,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set(\\"https://misskey-hub.net/ns#isCat\\", descriptor); @@ -169295,9 +169758,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set(\\"https://w3id.org/fep/6757#preferredLicense\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -169691,23 +170151,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -169857,23 +170325,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"publicKey\\", + [\\"https://w3id.org/security#publicKey\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -170286,23 +170762,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -170456,23 +170940,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"assertionMethod\\", + [\\"https://w3id.org/security#assertionMethod\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -170955,23 +171447,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"inbox\\", + [\\"http://www.w3.org/ns/ldp#inbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -171404,23 +171904,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"outbox\\", + [\\"https://www.w3.org/ns/activitystreams#outbox\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -171833,23 +172341,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"following\\", + [\\"https://www.w3.org/ns/activitystreams#following\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -172265,23 +172781,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"followers\\", + [\\"https://www.w3.org/ns/activitystreams#followers\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -172695,23 +173219,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"liked\\", + [\\"https://www.w3.org/ns/activitystreams#liked\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -173123,23 +173655,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featured\\", + [\\"http://joinmastodon.org/ns#featured\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -173551,23 +174091,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredTags\\", + [\\"http://joinmastodon.org/ns#featuredTags\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -173976,23 +174524,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"featuredCollections\\", + [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -174405,23 +174961,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"streams\\", + [\\"https://www.w3.org/ns/activitystreams#streams\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -174976,23 +175540,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"movedTo\\", + [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -175464,23 +176036,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -175634,23 +176214,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"alsoKnownAs\\", + [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -176063,23 +176651,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -176233,23 +176829,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + \\"service\\", + [\\"https://www.w3.org/ns/did#service\\"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger([\\"fedify\\", \\"vocab\\"]).debug( @@ -179994,9 +180598,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Source).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#content\\", descriptor); @@ -180024,9 +180625,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Source).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#mediaType\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -182030,9 +182628,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Tombstone).#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#formerType\\", descriptor); @@ -182063,9 +182658,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Tombstone).#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; - }, }; descriptors.set(\\"https://www.w3.org/ns/activitystreams#deleted\\", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index bd216045c..7d4474171 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -389,7 +389,6 @@ type RawPropertyEncoder = ( interface RawPropertyDescriptor { readonly canonicalIri: string; readonly encode: RawPropertyEncoder; - readonly values: (object: object) => readonly unknown[]; } // Unknown properties retained while decoding, keyed by the decoded object: @@ -421,97 +420,88 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } -function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { - if ( - source == null || destination == null || - typeof source !== "object" || typeof destination !== "object" || - !(RAW_PROPERTY_PROTOCOL in source) || !(RAW_PROPERTY_PROTOCOL in destination) - ) { - return false; - } - const sourceId = (source as unknown as { id: URL | null }).id; - const destinationId = (destination as unknown as { id: URL | null }).id; - return sourceId?.href === destinationId?.href; +// Embeds the context of a cached document in a document embedded in it, so +// that decoding the embedded document alone resolves its terms the same way +// as decoding the whole document did. Entries that the embedded document's +// own context repeats are left out, since applying them again later yields +// the same terms. Property-scoped contexts of the parent are not applied, as +// the embedded document is decoded as a top-level node: +function inheritJsonLdContext( + parentContext: unknown, + document: object, +): object { + const own = (document as { "@context"?: unknown })["@context"]; + const ownEntries = globalThis.Array.isArray(own) ? own : [own]; + const ownKeys = new Set( + ownEntries.map((entry) => globalThis.JSON.stringify(entry)), + ); + const context = [ + ...(globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]).filter((entry) => + !ownKeys.has(globalThis.JSON.stringify(entry)) + ), + ...ownEntries, + ]; + return { + ...document, + "@context": context.length === 1 ? context[0] : context, + }; } -function getRawPropertyDescriptors(object: object): Set { - const descriptors = new Set(); - let prototype: object | null = globalThis.Object.getPrototypeOf(object); - while (prototype != null) { - for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { - descriptors.add(descriptor); - } - prototype = globalThis.Object.getPrototypeOf(prototype); - } - return descriptors; -} +// The property IRIs each key of a compacted document expands to, keyed by +// the document: +const expandedKeys = new WeakMap>>(); -// Merges the retained unknown properties of a decoded object into a copy that -// was decoded again by a different class. The classes classify properties -// differently, so the copy keeps what it retained itself and gains the -// original's values for the properties its own class does not know either: -function mergeRawProperties(source: object, destination: object): void { - const retained = retainedRawProperties.get(source); - if (retained == null) return; - const merged: Record = { - ...retainedRawProperties.get(destination), - }; - let changed = false; - for (const [iri, values] of globalThis.Object.entries(retained)) { - if (getRawPropertyDescriptor(destination, iri) != null) continue; - merged[iri] = values; - changed = true; - } - if (changed) { - retainedRawProperties.set( - destination, - globalThis.Object.freeze(merged) as RetainedRawProperties, - ); - } +function expandKey( + document: Record, + key: string, + contextLoader: DocumentLoader, +): Promise { + let keys = expandedKeys.get(document); + if (keys == null) { + keys = new Map(); + expandedKeys.set(document, keys); + } + const cached = keys.get(key); + if (cached != null) return cached; + const iris = jsonld.expand( + { "@context": document["@context"], [key]: [] }, + { documentLoader: contextLoader, keepFreeFloatingNodes: true }, + ).then((expanded: unknown[]) => + globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => + !iri.startsWith("@") + ) + ); + // A failure, such as of the context loader, is not remembered, as another + // call can pass another loader: + const map = keys; + iris.catch(() => map.delete(key)); + keys.set(key, iris); + return iris; } -// Copies the retained unknown properties of a decoded object and of the -// objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. Only objects with the same -// id are paired. When the decoding dropped some values of a property, -// positions no longer correspond, so nested objects are paired by id alone. -// When the copy was decoded by a different class, the retained properties are -// merged rather than replaced, and only the properties both classes declare, -// matched by their IRIs, are followed: -function copyRawPropertiesDeep( - source: object, - destination: object, - visited: Set = new Set(), -): void { - if (visited.has(destination)) return; - visited.add(destination); - if (!isSameRawPropertyNode(source, destination)) return; - const sameClass = globalThis.Object.getPrototypeOf(source) === - globalThis.Object.getPrototypeOf(destination); - if (sameClass) copyRawProperties(source, destination); - else mergeRawProperties(source, destination); - for (const descriptor of getRawPropertyDescriptors(destination)) { - // Sibling classes declare the same property with distinct descriptors, so - // each object is read through its own class's descriptor: - const sourceDescriptor = sameClass - ? descriptor - : getRawPropertyDescriptor(source, descriptor.canonicalIri); - if (sourceDescriptor == null) continue; - const sources = sourceDescriptor.values(source); - const destinations = descriptor.values(destination); - const aligned = sources.length === destinations.length; - for (let i = 0; i < destinations.length; i++) { - const destination = destinations[i]; - const source = aligned - ? sources[i] - : (destination as { id?: URL | null } | null)?.id == null - ? undefined - : sources.find((s) => isSameRawPropertyNode(s, destination)); - if (source !== destination && isSameRawPropertyNode(source, destination)) { - copyRawPropertiesDeep(source as object, destination as object, visited); - } - } - } +// Whether a compacted document maps the given key, and no other key, to +// a property, so that the embedded documents under the key are the values +// decoded for the property. A context can remap the key to another property +// or map another term to the property, in which case the cached documents +// cannot be matched with the decoded values: +async function isCachedPropertyKey( + document: Record, + key: string, + iris: readonly string[], + contextLoader: DocumentLoader, +): Promise { + const own = await expandKey(document, key, contextLoader); + if (own.length !== 1 || own[0] !== iris[0]) return false; + const others = await globalThis.Promise.all( + globalThis.Object.keys(document) + .filter((k) => k !== key && !k.startsWith("@")) + // Keyword aliases, such as id, cannot take an empty array, and are + // not properties anyway: + .map((k) => expandKey(document, k, contextLoader).catch(() => [])), + ); + return !others.flat().some((iri) => iris.includes(iri)); } async function readRawProperty( @@ -4820,9 +4810,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#attachment", descriptor); @@ -4870,9 +4857,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#attributedTo", descriptor); @@ -4904,9 +4888,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#audience", descriptor); @@ -4937,9 +4918,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#content", descriptor); @@ -4975,9 +4953,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3mhZzGXSpQ431mBSz2kvych22v4e_context; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#context", descriptor); @@ -5008,9 +4983,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#name", descriptor); @@ -5041,9 +5013,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#endTime", descriptor); @@ -5079,9 +5048,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#generator", descriptor); @@ -5113,9 +5079,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#icon", descriptor); @@ -5147,9 +5110,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#image", descriptor); @@ -5185,9 +5145,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#inReplyTo", descriptor); @@ -5223,9 +5180,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#location", descriptor); @@ -5261,9 +5215,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#preview", descriptor); @@ -5294,9 +5245,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_5e258TDXtuhaFRPZiGoDfEpjdMr_published; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#published", descriptor); @@ -5328,9 +5276,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_7UpwM3JWcXhADcscukEehBorf6k_replies; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#replies", descriptor); @@ -5362,9 +5307,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3kAfck9PcEYt2L7xug5y99YPbANs_shares; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#shares", descriptor); @@ -5396,9 +5338,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#likes", descriptor); @@ -5430,9 +5369,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions; - }, }; descriptors.set("http://fedibird.com/ns#emojiReactions", descriptor); @@ -5463,9 +5399,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2w3Jmue4up8iVDUA51WZqomEF438_startTime; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#startTime", descriptor); @@ -5496,9 +5429,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#summary", descriptor); @@ -5534,9 +5464,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_5chuqj6s95p5gg2sk1HntGfarRf_tag; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#tag", descriptor); @@ -5567,9 +5494,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#updated", descriptor); @@ -5601,9 +5525,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#url", descriptor); @@ -5635,9 +5556,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#to", descriptor); @@ -5669,9 +5587,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#bto", descriptor); @@ -5703,9 +5618,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#cc", descriptor); @@ -5737,9 +5649,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#bcc", descriptor); @@ -5767,9 +5676,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#mediaType", descriptor); @@ -5800,9 +5706,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#duration", descriptor); @@ -5830,9 +5733,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#sensitive", descriptor); @@ -5864,9 +5764,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#source", descriptor); @@ -5898,9 +5795,6 @@ array.push({ "@graph": element }); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; - }, }; descriptors.set("https://w3id.org/security#proof", descriptor); @@ -5932,9 +5826,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy; - }, }; descriptors.set("https://gotosocial.org/ns#interactionPolicy", descriptor); @@ -5962,9 +5853,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; - }, }; descriptors.set("https://gotosocial.org/ns#approvedBy", descriptor); @@ -5996,9 +5884,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; - }, }; descriptors.set("https://gotosocial.org/ns#likeAuthorization", descriptor); @@ -6030,9 +5915,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; - }, }; descriptors.set("https://gotosocial.org/ns#replyAuthorization", descriptor); @@ -6064,9 +5946,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization; - }, }; descriptors.set("https://gotosocial.org/ns#announceAuthorization", descriptor); @@ -6098,9 +5977,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations; - }, }; descriptors.set("https://w3id.org/fep/22cd#translations", descriptor); @@ -6128,9 +6004,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Object).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; - }, }; descriptors.set("http://purl.org/dc/terms/license", descriptor); descriptors.set("https://schema.org/license", descriptor); @@ -6540,23 +6413,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#attachment_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "attachment", + ["https://www.w3.org/ns/activitystreams#attachment"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#attachment_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -7028,23 +6909,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#attribution_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "attributedTo", + ["https://www.w3.org/ns/activitystreams#attributedTo"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#attribution_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -7197,23 +7086,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#attribution_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "attributedTo", + ["https://www.w3.org/ns/activitystreams#attributedTo"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#attribution_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -7624,23 +7521,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#audience_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "audience", + ["https://www.w3.org/ns/activitystreams#audience"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#audience_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -7792,23 +7697,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#audience_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "audience", + ["https://www.w3.org/ns/activitystreams#audience"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#audience_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -8272,23 +8185,31 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#context_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "context", + ["https://www.w3.org/ns/activitystreams#context"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#context_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -8759,23 +8680,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#generator_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "generator", + ["https://www.w3.org/ns/activitystreams#generator"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#generator_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -9209,23 +9138,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#icon_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "icon", + ["https://www.w3.org/ns/activitystreams#icon"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#icon_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -9378,23 +9315,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#icon_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "icon", + ["https://www.w3.org/ns/activitystreams#icon"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#icon_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -9828,23 +9773,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#image_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "image", + ["https://www.w3.org/ns/activitystreams#image"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#image_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -9997,23 +9950,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#image_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "image", + ["https://www.w3.org/ns/activitystreams#image"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#image_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -10439,23 +10400,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#replyTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "inReplyTo", + ["https://www.w3.org/ns/activitystreams#inReplyTo"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replyTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -10607,23 +10576,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#replyTarget_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "inReplyTo", + ["https://www.w3.org/ns/activitystreams#inReplyTo"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replyTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -11049,23 +11026,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#location_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "location", + ["https://www.w3.org/ns/activitystreams#location"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#location_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -11217,23 +11202,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#location_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "location", + ["https://www.w3.org/ns/activitystreams#location"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#location_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -11658,23 +11651,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#preview_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "preview", + ["https://www.w3.org/ns/activitystreams#preview"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#preview_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -11825,23 +11826,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#preview_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "preview", + ["https://www.w3.org/ns/activitystreams#preview"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#preview_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -12265,23 +12274,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#replies_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "replies", + ["https://www.w3.org/ns/activitystreams#replies"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replies_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -12697,23 +12714,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#shares_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "shares", + ["https://www.w3.org/ns/activitystreams#shares"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#shares_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -13129,23 +13154,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#likes_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "likes", + ["https://www.w3.org/ns/activitystreams#likes"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likes_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -13555,23 +13588,31 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#emojiReactions_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "emojiReactions", + ["http://fedibird.com/ns#emojiReactions"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#emojiReactions_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -14042,23 +14083,31 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#tag_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "tag", + ["https://www.w3.org/ns/activitystreams#tag"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#tag_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -14503,23 +14552,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#to_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "to", + ["https://www.w3.org/ns/activitystreams#to"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#to_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -14671,23 +14728,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#to_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "to", + ["https://www.w3.org/ns/activitystreams#to"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#to_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -15098,23 +15163,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#bto_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "bto", + ["https://www.w3.org/ns/activitystreams#bto"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bto_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -15266,23 +15339,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#bto_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "bto", + ["https://www.w3.org/ns/activitystreams#bto"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bto_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -15693,23 +15774,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#cc_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "cc", + ["https://www.w3.org/ns/activitystreams#cc"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#cc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -15861,23 +15950,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#cc_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "cc", + ["https://www.w3.org/ns/activitystreams#cc"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#cc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -16288,23 +16385,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#bcc_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "bcc", + ["https://www.w3.org/ns/activitystreams#bcc"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bcc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -16456,23 +16561,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#bcc_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "bcc", + ["https://www.w3.org/ns/activitystreams#bcc"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#bcc_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -16946,23 +17059,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#proof_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "proof", + ["https://w3id.org/security#proof"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#proof_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -17113,23 +17234,31 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#proof_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "proof", + ["https://w3id.org/security#proof"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#proof_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -17579,23 +17708,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#likeAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "likeAuthorization", + ["https://gotosocial.org/ns#likeAuthorization"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likeAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -18005,23 +18142,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#replyAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "replyAuthorization", + ["https://gotosocial.org/ns#replyAuthorization"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#replyAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -18431,23 +18576,31 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#announceAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "announceAuthorization", + ["https://gotosocial.org/ns#announceAuthorization"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#announceAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -24551,9 +24704,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ChatMessage).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set("https://w3id.org/fep/044f#quote", descriptor); @@ -24581,9 +24731,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ChatMessage).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#quoteUrl", descriptor); descriptors.set("https://misskey-hub.net/ns#_misskey_quote", descriptor); @@ -24617,9 +24764,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ChatMessage).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set("https://w3id.org/fep/044f#quoteAuthorization", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -24993,23 +25137,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "quote", + ["https://w3id.org/fep/044f#quote"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -25442,23 +25594,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "quoteAuthorization", + ["https://w3id.org/fep/044f#quoteAuthorization"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -27371,9 +27531,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#actor", descriptor); @@ -27405,9 +27562,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#object", descriptor); @@ -27439,9 +27593,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#target", descriptor); @@ -27473,9 +27624,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#result", descriptor); @@ -27507,9 +27655,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_25zu2s3VxVujgEKqrDycjE284XQR_origin; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#origin", descriptor); @@ -27541,9 +27686,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Activity).#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#instrument", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -27977,23 +28119,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#actor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "actor", + ["https://www.w3.org/ns/activitystreams#actor"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#actor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -28146,23 +28296,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#actor_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "actor", + ["https://www.w3.org/ns/activitystreams#actor"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#actor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -28574,23 +28732,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#object_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "object", + ["https://www.w3.org/ns/activitystreams#object"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -28743,23 +28909,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#object_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "object", + ["https://www.w3.org/ns/activitystreams#object"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -29174,23 +29348,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#target_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "target", + ["https://www.w3.org/ns/activitystreams#target"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#target_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -29346,23 +29528,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#target_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "target", + ["https://www.w3.org/ns/activitystreams#target"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#target_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -29774,23 +29964,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#result_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "result", + ["https://www.w3.org/ns/activitystreams#result"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#result_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -29943,23 +30141,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#result_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "result", + ["https://www.w3.org/ns/activitystreams#result"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#result_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -30372,23 +30578,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#origin_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "origin", + ["https://www.w3.org/ns/activitystreams#origin"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#origin_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -30542,23 +30756,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#origin_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "origin", + ["https://www.w3.org/ns/activitystreams#origin"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#origin_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -30969,23 +31191,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#instrument_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "instrument", + ["https://www.w3.org/ns/activitystreams#instrument"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#instrument_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -31137,23 +31367,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#instrument_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "instrument", + ["https://www.w3.org/ns/activitystreams#instrument"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#instrument_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -33200,9 +33438,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as PropertyValue).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#name", descriptor); @@ -33233,9 +33468,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as PropertyValue).#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value; - }, }; descriptors.set("http://schema.org#value", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -34159,9 +34391,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Measure).#_27fgyFbosTtMAhuepJH8K3ZGURT6; - }, }; descriptors.set("http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit", descriptor); @@ -34192,9 +34421,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Measure).#_1GQx8o2RgxRs4x9G5uT39XYBv7D; - }, }; descriptors.set("http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -35081,9 +35307,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as AnnounceAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); @@ -35115,9 +35338,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as AnnounceAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -35490,23 +35710,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactingObject", + ["https://gotosocial.org/ns#interactingObject"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -35915,23 +36143,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactionTarget", + ["https://gotosocial.org/ns#interactionTarget"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -37655,9 +37891,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature; - }, }; descriptors.set("https://w3id.org/fep/7aa9#canFeature", descriptor); @@ -37689,9 +37922,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike; - }, }; descriptors.set("https://gotosocial.org/ns#canLike", descriptor); @@ -37723,9 +37953,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply; - }, }; descriptors.set("https://gotosocial.org/ns#canReply", descriptor); @@ -37757,9 +37984,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce; - }, }; descriptors.set("https://gotosocial.org/ns#canAnnounce", descriptor); @@ -37791,9 +38015,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionPolicy).#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; - }, }; descriptors.set("https://gotosocial.org/ns#canQuote", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -39252,9 +39473,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionRule).#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval; - }, }; descriptors.set("https://gotosocial.org/ns#automaticApproval", descriptor); @@ -39282,9 +39500,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as InteractionRule).#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; - }, }; descriptors.set("https://gotosocial.org/ns#manualApproval", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -40151,9 +40366,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as LikeAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); @@ -40185,9 +40397,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as LikeAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -40560,23 +40769,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactingObject", + ["https://gotosocial.org/ns#interactingObject"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -40985,23 +41202,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactionTarget", + ["https://gotosocial.org/ns#interactionTarget"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -42503,9 +42728,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ReplyAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); @@ -42537,9 +42759,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as ReplyAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -42912,23 +43131,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactingObject", + ["https://gotosocial.org/ns#interactingObject"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -43337,23 +43564,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactionTarget", + ["https://gotosocial.org/ns#interactionTarget"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -44855,9 +45090,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as QuoteAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); @@ -44889,9 +45121,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as QuoteAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -45263,23 +45492,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactingObject", + ["https://gotosocial.org/ns#interactingObject"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -45688,23 +45925,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactionTarget", + ["https://gotosocial.org/ns#interactionTarget"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -47633,9 +47878,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_diXuPmFWiEqfLPhhrxg6Xc7ixZG; - }, }; descriptors.set("https://schema.org/inLanguage", descriptor); @@ -47683,9 +47925,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; - }, }; descriptors.set("https://schema.org/translator", descriptor); @@ -47713,9 +47952,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_Msz9PwRg7cWkiXPL4ixyQLtuuH7; - }, }; descriptors.set("https://schema.org/translationOfWork", descriptor); @@ -47746,9 +47982,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated; - }, }; descriptors.set("https://w3id.org/fep/22cd#sourceUpdated", descriptor); @@ -47776,9 +48009,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_4KvkQNz1JjGs8S7iJDcGrUYETbUW; - }, }; descriptors.set("https://schema.org/isBasedOn", descriptor); @@ -47810,9 +48040,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Translation).#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#url", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -48264,23 +48491,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#translator_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "translator", + ["https://schema.org/translator"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#translator_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -48436,23 +48671,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#translator_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "translator", + ["https://schema.org/translator"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#translator_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -49888,9 +50131,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeatureAuthorization).#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; - }, }; descriptors.set("https://gotosocial.org/ns#interactingObject", descriptor); @@ -49922,9 +50162,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeatureAuthorization).#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; - }, }; descriptors.set("https://gotosocial.org/ns#interactionTarget", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -50295,23 +50532,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactingObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactingObject", + ["https://gotosocial.org/ns#interactingObject"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactingObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -50719,23 +50964,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#interactionTarget_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "interactionTarget", + ["https://gotosocial.org/ns#interactionTarget"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#interactionTarget_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -52864,9 +53117,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#totalItems", descriptor); @@ -52898,9 +53148,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_3UyUdxnyn6cDn53QKrh4MBiearma_current; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#current", descriptor); @@ -52932,9 +53179,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_J52RqweMe6hhv7RnLJMC8BExTE5_first; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#first", descriptor); @@ -52966,9 +53210,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#last", descriptor); @@ -53004,9 +53245,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#items", descriptor); @@ -53038,9 +53276,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; - }, }; descriptors.set("https://w3id.org/fep/5711#likesOf", descriptor); @@ -53072,9 +53307,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; - }, }; descriptors.set("https://w3id.org/fep/5711#sharesOf", descriptor); @@ -53106,9 +53338,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; - }, }; descriptors.set("https://w3id.org/fep/5711#repliesOf", descriptor); @@ -53140,9 +53369,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; - }, }; descriptors.set("https://w3id.org/fep/5711#inboxOf", descriptor); @@ -53174,9 +53400,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; - }, }; descriptors.set("https://w3id.org/fep/5711#outboxOf", descriptor); @@ -53208,9 +53431,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; - }, }; descriptors.set("https://w3id.org/fep/5711#followersOf", descriptor); @@ -53242,9 +53462,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; - }, }; descriptors.set("https://w3id.org/fep/5711#followingOf", descriptor); @@ -53276,9 +53493,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Collection).#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; - }, }; descriptors.set("https://w3id.org/fep/5711#likedOf", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -53667,23 +53881,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#current_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "current", + ["https://www.w3.org/ns/activitystreams#current"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#current_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -54093,23 +54315,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#first_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "first", + ["https://www.w3.org/ns/activitystreams#first"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#first_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -54519,23 +54749,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#last_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "last", + ["https://www.w3.org/ns/activitystreams#last"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#last_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -54964,23 +55202,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#item_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "items", + ["https://www.w3.org/ns/activitystreams#items"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#item_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -55390,23 +55636,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#likesOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "likesOf", + ["https://w3id.org/fep/5711#likesOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likesOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -55815,23 +56069,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#sharesOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "sharesOf", + ["https://w3id.org/fep/5711#sharesOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#sharesOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -56240,23 +56502,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#repliesOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "repliesOf", + ["https://w3id.org/fep/5711#repliesOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#repliesOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -56665,23 +56935,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#inboxOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "inboxOf", + ["https://w3id.org/fep/5711#inboxOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inboxOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -57090,23 +57368,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#outboxOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "outboxOf", + ["https://w3id.org/fep/5711#outboxOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outboxOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -57515,23 +57801,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#followersOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "followersOf", + ["https://w3id.org/fep/5711#followersOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followersOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -57940,23 +58234,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#followingOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "followingOf", + ["https://w3id.org/fep/5711#followingOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followingOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -58365,23 +58667,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#likedOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "likedOf", + ["https://w3id.org/fep/5711#likedOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#likedOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -60575,9 +60885,6 @@ array.push(element); if (array.length < 1) return undefined; return { "@list": array }; }, - values(object: object): readonly unknown[] { - return (object as OrderedCollection).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#items", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -60969,23 +61276,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#item_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "orderedItems", + ["https://www.w3.org/ns/activitystreams#items"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#item_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -61819,9 +62134,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedCollection).#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic; - }, }; descriptors.set("https://w3id.org/fep/7aa9#topic", descriptor); @@ -61849,9 +62161,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedCollection).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -62764,9 +63073,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedItem).#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; - }, }; descriptors.set("https://w3id.org/fep/7aa9#featuredObject", descriptor); @@ -62798,9 +63104,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as FeaturedItem).#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; - }, }; descriptors.set("https://w3id.org/fep/7aa9#featureAuthorization", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -63171,23 +63474,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredObject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredObject", + ["https://w3id.org/fep/7aa9#featuredObject"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredObject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -63597,23 +63908,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featureAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featureAuthorization", + ["https://w3id.org/fep/7aa9#featureAuthorization"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featureAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -64682,9 +65001,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DidService).#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; - }, }; descriptors.set("https://www.w3.org/ns/did#serviceEndpoint", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -66070,9 +66386,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite; - }, }; descriptors.set("https://w3id.org/security#cryptosuite", descriptor); @@ -66104,9 +66417,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod; - }, }; descriptors.set("https://w3id.org/security#verificationMethod", descriptor); @@ -66136,9 +66446,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose; - }, }; descriptors.set("https://w3id.org/security#proofPurpose", descriptor); @@ -66169,9 +66476,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue; - }, }; descriptors.set("https://w3id.org/security#proofValue", descriptor); @@ -66202,9 +66506,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as DataIntegrityProof).#_3qzP3ukEZoUziK5FEiA1RhU4aqac; - }, }; descriptors.set("http://purl.org/dc/terms/created", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -67772,9 +68073,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CryptographicKey).#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner; - }, }; descriptors.set("https://w3id.org/security#owner", descriptor); @@ -67802,9 +68100,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CryptographicKey).#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem; - }, }; descriptors.set("https://w3id.org/security#publicKeyPem", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -68235,23 +68530,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#owner_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "owner", + ["https://w3id.org/security#owner"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#owner_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -69320,9 +69623,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Multikey).#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller; - }, }; descriptors.set("https://w3id.org/security#controller", descriptor); @@ -69353,9 +69653,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Multikey).#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase; - }, }; descriptors.set("https://w3id.org/security#publicKeyMultibase", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -69786,23 +70083,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#controller_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "controller", + ["https://w3id.org/security#controller"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#controller_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -70799,9 +71104,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Agreement).#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#stipulates", descriptor); @@ -70833,9 +71135,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Agreement).#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#stipulatesReciprocal", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -71834,9 +72133,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Commitment).#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#satisfies", descriptor); @@ -71868,9 +72164,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Commitment).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#resourceQuantity", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -72962,9 +73255,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#action", descriptor); @@ -72992,9 +73282,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#resourceConformsTo", descriptor); @@ -73026,9 +73313,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#resourceQuantity", descriptor); @@ -73060,9 +73344,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#availableQuantity", descriptor); @@ -73094,9 +73375,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Intent).#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#minimumQuantity", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -74372,9 +74650,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#purpose", descriptor); @@ -74406,9 +74681,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#publishes", descriptor); @@ -74440,9 +74712,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#reciprocal", descriptor); @@ -74470,9 +74739,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Proposal).#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased; - }, }; descriptors.set("https://w3id.org/valueflows/ont/vf#unitBased", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -78986,9 +79252,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); @@ -79020,9 +79283,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set("https://w3id.org/security#publicKey", descriptor); @@ -79054,9 +79314,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set("https://w3id.org/security#assertionMethod", descriptor); @@ -79084,9 +79341,6 @@ array.push(element); if (array.length < 1) return undefined; return { "@list": array }; }, - values(object: object): readonly unknown[] { - return (object as Application).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); @@ -79114,9 +79368,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); @@ -79152,9 +79403,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); @@ -79190,9 +79438,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); @@ -79224,9 +79469,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); @@ -79258,9 +79500,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); @@ -79292,9 +79531,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); @@ -79326,9 +79562,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set("http://joinmastodon.org/ns#featured", descriptor); @@ -79360,9 +79593,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); @@ -79394,9 +79624,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); @@ -79428,9 +79655,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); @@ -79462,9 +79686,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); @@ -79492,9 +79713,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); @@ -79522,9 +79740,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); @@ -79552,9 +79767,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); @@ -79582,9 +79794,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); @@ -79612,9 +79821,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); @@ -79662,9 +79868,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); @@ -79712,9 +79915,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); @@ -79746,9 +79946,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set("https://www.w3.org/ns/did#service", descriptor); @@ -79776,9 +79973,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); @@ -79806,9 +80000,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); @@ -79836,9 +80027,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Application).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -80232,23 +80420,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -80398,23 +80594,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -80827,23 +81031,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -80997,23 +81209,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -81496,23 +81716,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "inbox", + ["http://www.w3.org/ns/ldp#inbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -81945,23 +82173,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "outbox", + ["https://www.w3.org/ns/activitystreams#outbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -82374,23 +82610,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "following", + ["https://www.w3.org/ns/activitystreams#following"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -82806,23 +83050,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "followers", + ["https://www.w3.org/ns/activitystreams#followers"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -83236,23 +83488,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "liked", + ["https://www.w3.org/ns/activitystreams#liked"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -83664,23 +83924,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featured", + ["http://joinmastodon.org/ns#featured"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -84092,23 +84360,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredTags", + ["http://joinmastodon.org/ns#featuredTags"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -84517,23 +84793,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredCollections", + ["https://w3id.org/fep/7aa9#featuredCollections"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -84946,23 +85230,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "streams", + ["https://www.w3.org/ns/activitystreams#streams"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -85517,23 +85809,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "movedTo", + ["https://www.w3.org/ns/activitystreams#movedTo"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -86005,23 +86305,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -86175,23 +86483,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -86604,23 +86920,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -86774,23 +87098,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -91547,9 +91879,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Article).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set("https://w3id.org/fep/044f#quote", descriptor); @@ -91577,9 +91906,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Article).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#quoteUrl", descriptor); descriptors.set("https://misskey-hub.net/ns#_misskey_quote", descriptor); @@ -91613,9 +91939,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Article).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set("https://w3id.org/fep/044f#quoteAuthorization", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -91989,23 +92312,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "quote", + ["https://w3id.org/fep/044f#quote"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -92438,23 +92769,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "quoteAuthorization", + ["https://w3id.org/fep/044f#quoteAuthorization"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -93479,9 +93818,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Document).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#width", descriptor); @@ -93512,9 +93848,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Document).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#height", descriptor); @@ -93542,9 +93875,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Document).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; - }, }; descriptors.set("https://www.w3.org/ns/credentials/v2#digestMultibase", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -96234,9 +96564,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CollectionPage).#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#partOf", descriptor); @@ -96268,9 +96595,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CollectionPage).#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#next", descriptor); @@ -96302,9 +96626,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as CollectionPage).#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#prev", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -96677,23 +96998,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#partOf_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "partOf", + ["https://www.w3.org/ns/activitystreams#partOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#partOf_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -97101,23 +97430,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#next_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "next", + ["https://www.w3.org/ns/activitystreams#next"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#next_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -97526,23 +97863,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#prev_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "prev", + ["https://www.w3.org/ns/activitystreams#prev"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#prev_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -100529,9 +100874,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#proxyUrl", descriptor); @@ -100559,9 +100901,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint", descriptor); @@ -100589,9 +100928,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#oauthTokenEndpoint", descriptor); @@ -100619,9 +100955,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#provideClientKey", descriptor); @@ -100649,9 +100982,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#signClientKey", descriptor); @@ -100679,9 +101009,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#sharedInbox", descriptor); @@ -100709,9 +101036,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Endpoints).#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#uploadMedia", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -105492,9 +105816,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); @@ -105526,9 +105847,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set("https://w3id.org/security#publicKey", descriptor); @@ -105560,9 +105878,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set("https://w3id.org/security#assertionMethod", descriptor); @@ -105590,9 +105905,6 @@ array.push(element); if (array.length < 1) return undefined; return { "@list": array }; }, - values(object: object): readonly unknown[] { - return (object as Group).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); @@ -105620,9 +105932,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); @@ -105658,9 +105967,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); @@ -105696,9 +106002,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); @@ -105730,9 +106033,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); @@ -105764,9 +106064,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); @@ -105798,9 +106095,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); @@ -105832,9 +106126,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set("http://joinmastodon.org/ns#featured", descriptor); @@ -105866,9 +106157,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); @@ -105900,9 +106188,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); @@ -105934,9 +106219,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); @@ -105968,9 +106250,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); @@ -105998,9 +106277,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); @@ -106028,9 +106304,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); @@ -106058,9 +106331,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); @@ -106088,9 +106358,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); @@ -106118,9 +106385,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); @@ -106168,9 +106432,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); @@ -106218,9 +106479,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); @@ -106252,9 +106510,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set("https://www.w3.org/ns/did#service", descriptor); @@ -106282,9 +106537,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); @@ -106312,9 +106564,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); @@ -106342,9 +106591,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Group).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -106738,23 +106984,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -106904,23 +107158,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -107333,23 +107595,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -107503,23 +107773,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -108002,23 +108280,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "inbox", + ["http://www.w3.org/ns/ldp#inbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -108451,23 +108737,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "outbox", + ["https://www.w3.org/ns/activitystreams#outbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -108880,23 +109174,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "following", + ["https://www.w3.org/ns/activitystreams#following"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -109312,23 +109614,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "followers", + ["https://www.w3.org/ns/activitystreams#followers"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -109742,23 +110052,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "liked", + ["https://www.w3.org/ns/activitystreams#liked"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -110170,23 +110488,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featured", + ["http://joinmastodon.org/ns#featured"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -110598,23 +110924,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredTags", + ["http://joinmastodon.org/ns#featuredTags"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -111023,23 +111357,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredCollections", + ["https://w3id.org/fep/7aa9#featuredCollections"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -111452,23 +111794,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "streams", + ["https://www.w3.org/ns/activitystreams#streams"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -112023,23 +112373,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "movedTo", + ["https://www.w3.org/ns/activitystreams#movedTo"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -112511,23 +112869,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -112681,23 +113047,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -113110,23 +113484,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -113280,23 +113662,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -117546,9 +117936,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#href", descriptor); @@ -117576,9 +117963,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#rel", descriptor); @@ -117606,9 +117990,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#mediaType", descriptor); @@ -117636,9 +118017,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase; - }, }; descriptors.set("https://www.w3.org/ns/credentials/v2#digestMultibase", descriptor); @@ -117669,9 +118047,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#name", descriptor); @@ -117699,9 +118074,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#hreflang", descriptor); @@ -117732,9 +118104,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#height", descriptor); @@ -117765,9 +118134,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#width", descriptor); @@ -117803,9 +118169,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#preview", descriptor); @@ -117833,9 +118196,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Link).#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; - }, }; descriptors.set("http://purl.org/dc/terms/license", descriptor); descriptors.set("https://schema.org/license", descriptor); @@ -118372,23 +118732,31 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#preview_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "preview", + ["https://www.w3.org/ns/activitystreams#preview"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#preview_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -125392,9 +125760,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Note).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set("https://w3id.org/fep/044f#quote", descriptor); @@ -125422,9 +125787,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Note).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#quoteUrl", descriptor); descriptors.set("https://misskey-hub.net/ns#_misskey_quote", descriptor); @@ -125458,9 +125820,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Note).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set("https://w3id.org/fep/044f#quoteAuthorization", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -125834,23 +126193,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "quote", + ["https://w3id.org/fep/044f#quote"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -126283,23 +126650,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "quoteAuthorization", + ["https://w3id.org/fep/044f#quoteAuthorization"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -127395,9 +127770,6 @@ array.push(element); if (array.length < 1) return undefined; return { "@list": array }; }, - values(object: object): readonly unknown[] { - return (object as OrderedCollectionPage).#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#items", descriptor); @@ -127428,9 +127800,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as OrderedCollectionPage).#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#startIndex", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -127822,23 +128191,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#item_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "orderedItems", + ["https://www.w3.org/ns/activitystreams#items"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#item_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -130572,9 +130949,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); @@ -130606,9 +130980,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set("https://w3id.org/security#publicKey", descriptor); @@ -130640,9 +131011,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set("https://w3id.org/security#assertionMethod", descriptor); @@ -130670,9 +131038,6 @@ array.push(element); if (array.length < 1) return undefined; return { "@list": array }; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); @@ -130700,9 +131065,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); @@ -130738,9 +131100,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); @@ -130776,9 +131135,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); @@ -130810,9 +131166,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); @@ -130844,9 +131197,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); @@ -130878,9 +131228,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); @@ -130912,9 +131259,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set("http://joinmastodon.org/ns#featured", descriptor); @@ -130946,9 +131290,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); @@ -130980,9 +131321,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); @@ -131014,9 +131352,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); @@ -131048,9 +131383,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); @@ -131078,9 +131410,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); @@ -131108,9 +131437,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); @@ -131138,9 +131464,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); @@ -131168,9 +131491,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); @@ -131198,9 +131518,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); @@ -131248,9 +131565,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); @@ -131298,9 +131612,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); @@ -131332,9 +131643,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set("https://www.w3.org/ns/did#service", descriptor); @@ -131362,9 +131670,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); @@ -131392,9 +131697,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); @@ -131422,9 +131724,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Organization).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -131818,23 +132117,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -131984,23 +132291,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -132413,23 +132728,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -132583,23 +132906,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -133082,23 +133413,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "inbox", + ["http://www.w3.org/ns/ldp#inbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -133531,23 +133870,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "outbox", + ["https://www.w3.org/ns/activitystreams#outbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -133960,23 +134307,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "following", + ["https://www.w3.org/ns/activitystreams#following"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -134392,23 +134747,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "followers", + ["https://www.w3.org/ns/activitystreams#followers"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -134822,23 +135185,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "liked", + ["https://www.w3.org/ns/activitystreams#liked"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -135250,23 +135621,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featured", + ["http://joinmastodon.org/ns#featured"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -135678,23 +136057,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredTags", + ["http://joinmastodon.org/ns#featuredTags"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -136103,23 +136490,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredCollections", + ["https://w3id.org/fep/7aa9#featuredCollections"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -136532,23 +136927,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "streams", + ["https://www.w3.org/ns/activitystreams#streams"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -137103,23 +137506,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "movedTo", + ["https://www.w3.org/ns/activitystreams#movedTo"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -137591,23 +138002,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -137761,23 +138180,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -138190,23 +138617,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -138360,23 +138795,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -144303,9 +144746,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); @@ -144337,9 +144777,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set("https://w3id.org/security#publicKey", descriptor); @@ -144371,9 +144808,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set("https://w3id.org/security#assertionMethod", descriptor); @@ -144401,9 +144835,6 @@ array.push(element); if (array.length < 1) return undefined; return { "@list": array }; }, - values(object: object): readonly unknown[] { - return (object as Person).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); @@ -144431,9 +144862,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); @@ -144469,9 +144897,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); @@ -144507,9 +144932,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); @@ -144541,9 +144963,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); @@ -144575,9 +144994,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); @@ -144609,9 +145025,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); @@ -144643,9 +145056,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set("http://joinmastodon.org/ns#featured", descriptor); @@ -144677,9 +145087,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); @@ -144711,9 +145118,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); @@ -144745,9 +145149,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); @@ -144779,9 +145180,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); @@ -144809,9 +145207,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); @@ -144839,9 +145234,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); @@ -144869,9 +145261,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); @@ -144899,9 +145288,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); @@ -144929,9 +145315,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); @@ -144979,9 +145362,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); @@ -145029,9 +145409,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); @@ -145063,9 +145440,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set("https://www.w3.org/ns/did#service", descriptor); @@ -145093,9 +145467,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); @@ -145123,9 +145494,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); @@ -145153,9 +145521,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Person).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -145549,23 +145914,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -145715,23 +146088,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -146144,23 +146525,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -146314,23 +146703,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -146813,23 +147210,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "inbox", + ["http://www.w3.org/ns/ldp#inbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -147262,23 +147667,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "outbox", + ["https://www.w3.org/ns/activitystreams#outbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -147691,23 +148104,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "following", + ["https://www.w3.org/ns/activitystreams#following"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -148123,23 +148544,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "followers", + ["https://www.w3.org/ns/activitystreams#followers"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -148553,23 +148982,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "liked", + ["https://www.w3.org/ns/activitystreams#liked"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -148981,23 +149418,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featured", + ["http://joinmastodon.org/ns#featured"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -149409,23 +149854,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredTags", + ["http://joinmastodon.org/ns#featuredTags"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -149834,23 +150287,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredCollections", + ["https://w3id.org/fep/7aa9#featuredCollections"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -150263,23 +150724,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "streams", + ["https://www.w3.org/ns/activitystreams#streams"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -150834,23 +151303,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "movedTo", + ["https://www.w3.org/ns/activitystreams#movedTo"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -151322,23 +151799,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -151492,23 +151977,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -151921,23 +152414,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -152091,23 +152592,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -155810,9 +156319,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#accuracy", descriptor); @@ -155843,9 +156349,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#altitude", descriptor); @@ -155876,9 +156379,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#latitude", descriptor); @@ -155909,9 +156409,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#longitude", descriptor); @@ -155942,9 +156439,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#radius", descriptor); @@ -155972,9 +156466,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Place).#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#units", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -157239,9 +157730,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Profile).#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#describes", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -157614,23 +158102,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#describes_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "describes", + ["https://www.w3.org/ns/activitystreams#describes"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#describes_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -158823,9 +159319,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#oneOf", descriptor); @@ -158857,9 +159350,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#anyOf", descriptor); @@ -158890,9 +159380,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#closed", descriptor); @@ -158923,9 +159410,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount; - }, }; descriptors.set("http://joinmastodon.org/ns#votersCount", descriptor); @@ -158957,9 +159441,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; - }, }; descriptors.set("https://w3id.org/fep/044f#quote", descriptor); @@ -158987,9 +159468,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#quoteUrl", descriptor); descriptors.set("https://misskey-hub.net/ns#_misskey_quote", descriptor); @@ -159023,9 +159501,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Question).#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; - }, }; descriptors.set("https://w3id.org/fep/044f#quoteAuthorization", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -159403,23 +159878,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#exclusiveOption_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "oneOf", + ["https://www.w3.org/ns/activitystreams#oneOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#exclusiveOption_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -159835,23 +160318,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#inclusiveOption_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "anyOf", + ["https://www.w3.org/ns/activitystreams#anyOf"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inclusiveOption_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -160293,23 +160784,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#quote_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "quote", + ["https://w3id.org/fep/044f#quote"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quote_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -160742,23 +161241,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#quoteAuthorization_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "quoteAuthorization", + ["https://w3id.org/fep/044f#quoteAuthorization"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#quoteAuthorization_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -163416,9 +163923,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Relationship).#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#subject", descriptor); @@ -163450,9 +163954,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Relationship).#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#object", descriptor); @@ -163484,9 +163985,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Relationship).#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#relationship", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -163861,23 +164359,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#subject_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "subject", + ["https://www.w3.org/ns/activitystreams#subject"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#subject_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -164286,23 +164792,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#object_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "object", + ["https://www.w3.org/ns/activitystreams#object"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -164453,23 +164967,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#object_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "object", + ["https://www.w3.org/ns/activitystreams#object"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#object_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -164881,23 +165403,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#relationship_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "relationship", + ["https://www.w3.org/ns/activitystreams#relationship"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#relationship_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -165050,23 +165580,31 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#relationship_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "relationship", + ["https://www.w3.org/ns/activitystreams#relationship"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#relationship_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -168447,9 +168985,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#preferredUsername", descriptor); @@ -168481,9 +169016,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; - }, }; descriptors.set("https://w3id.org/security#publicKey", descriptor); @@ -168515,9 +169047,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; - }, }; descriptors.set("https://w3id.org/security#assertionMethod", descriptor); @@ -168545,9 +169074,6 @@ array.push(element); if (array.length < 1) return undefined; return { "@list": array }; }, - values(object: object): readonly unknown[] { - return (object as Service).#_hQiaHhZP8hqxckxTBrpsGNs57E3; - }, }; descriptors.set("https://w3id.org/fep/ef61/gateways", descriptor); @@ -168575,9 +169101,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers", descriptor); @@ -168613,9 +169136,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; - }, }; descriptors.set("http://www.w3.org/ns/ldp#inbox", descriptor); @@ -168651,9 +169171,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_41QwhqJouoLg3h8dRPKat21brynC_outbox; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#outbox", descriptor); @@ -168685,9 +169202,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#following", descriptor); @@ -168719,9 +169233,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#followers", descriptor); @@ -168753,9 +169264,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#liked", descriptor); @@ -168787,9 +169295,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; - }, }; descriptors.set("http://joinmastodon.org/ns#featured", descriptor); @@ -168821,9 +169326,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; - }, }; descriptors.set("http://joinmastodon.org/ns#featuredTags", descriptor); @@ -168855,9 +169357,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; - }, }; descriptors.set("https://w3id.org/fep/7aa9#featuredCollections", descriptor); @@ -168889,9 +169388,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#streams", descriptor); @@ -168923,9 +169419,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#endpoints", descriptor); @@ -168953,9 +169446,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable; - }, }; descriptors.set("http://joinmastodon.org/ns#discoverable", descriptor); @@ -168983,9 +169473,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended; - }, }; descriptors.set("http://joinmastodon.org/ns#suspended", descriptor); @@ -169013,9 +169500,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial; - }, }; descriptors.set("http://joinmastodon.org/ns#memorial", descriptor); @@ -169043,9 +169527,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; - }, }; descriptors.set("http://joinmastodon.org/ns#indexable", descriptor); @@ -169073,9 +169554,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4QMetaJKCxkz7wX64M2TuXRgNjB6_attributionDomains; - }, }; descriptors.set("http://joinmastodon.org/ns#attributionDomains", descriptor); @@ -169123,9 +169601,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#movedTo", descriptor); @@ -169173,9 +169648,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#alsoKnownAs", descriptor); @@ -169207,9 +169679,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; - }, }; descriptors.set("https://www.w3.org/ns/did#service", descriptor); @@ -169237,9 +169706,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage; - }, }; descriptors.set("https://misskey-hub.net/ns#_misskey_followedMessage", descriptor); @@ -169267,9 +169733,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat; - }, }; descriptors.set("https://misskey-hub.net/ns#isCat", descriptor); @@ -169297,9 +169760,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Service).#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; - }, }; descriptors.set("https://w3id.org/fep/6757#preferredLicense", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -169693,23 +170153,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -169859,23 +170327,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#publicKey_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "publicKey", + ["https://w3id.org/security#publicKey"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#publicKey_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -170288,23 +170764,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -170458,23 +170942,31 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#assertionMethod_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "assertionMethod", + ["https://w3id.org/security#assertionMethod"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#assertionMethod_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -170957,23 +171449,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#inbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "inbox", + ["http://www.w3.org/ns/ldp#inbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#inbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -171406,23 +171906,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#outbox_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "outbox", + ["https://www.w3.org/ns/activitystreams#outbox"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#outbox_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -171835,23 +172343,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#following_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "following", + ["https://www.w3.org/ns/activitystreams#following"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#following_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -172267,23 +172783,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#followers_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "followers", + ["https://www.w3.org/ns/activitystreams#followers"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#followers_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -172697,23 +173221,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#liked_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "liked", + ["https://www.w3.org/ns/activitystreams#liked"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#liked_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -173125,23 +173657,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featured_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featured", + ["http://joinmastodon.org/ns#featured"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featured_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -173553,23 +174093,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredTags_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredTags", + ["http://joinmastodon.org/ns#featuredTags"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredTags_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -173978,23 +174526,31 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#featuredCollections_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "featuredCollections", + ["https://w3id.org/fep/7aa9#featuredCollections"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#featuredCollections_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -174407,23 +174963,31 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#stream_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "streams", + ["https://www.w3.org/ns/activitystreams#streams"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#stream_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -174978,23 +175542,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#successor_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "movedTo", + ["https://www.w3.org/ns/activitystreams#movedTo"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#successor_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -175466,23 +176038,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -175636,23 +176216,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#alias_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "alsoKnownAs", + ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#alias_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -176065,23 +176653,31 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#service_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -176235,23 +176831,31 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#service_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + "service", + ["https://www.w3.org/ns/did#service"], + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#service_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -179996,9 +180600,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Source).#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#content", descriptor); @@ -180026,9 +180627,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Source).#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#mediaType", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); @@ -182032,9 +182630,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Tombstone).#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#formerType", descriptor); @@ -182065,9 +182660,6 @@ array.push(element); if (array.length < 1) return undefined; return array; }, - values(object: object): readonly unknown[] { - return (object as Tombstone).#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; - }, }; descriptors.set("https://www.w3.org/ns/activitystreams#deleted", descriptor); rawPropertyDescriptors.set(this.prototype, descriptors); diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index 5cbc8b545..cf4fdd78b 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -491,17 +491,30 @@ async function* generateProperty( const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const decoded = v; - v = await this.#${property.singularName}_fromJsonLd(doc, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: ${cachedPropertyBaseUrl}, - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + ${JSON.stringify(property.compactName)}, + ${ + JSON.stringify([ + property.uri, + ...(property.redundantProperties ?? []).map((p) => p.uri), + ]) + }, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#${property.singularName}_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: ${cachedPropertyBaseUrl}, + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( @@ -677,17 +690,30 @@ async function* generateProperty( const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const decoded = v; - v = await this.#${property.singularName}_fromJsonLd(obj, { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: ${cachedPropertyBaseUrl}, - }); - // The cached document lacks the parent's context, so the - // unknown properties retained from the whole document, including - // those of nested objects, win: - copyRawPropertiesDeep(decoded, v); + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + ${JSON.stringify(property.compactName)}, + ${ + JSON.stringify([ + property.uri, + ...(property.redundantProperties ?? []).map((p) => p.uri), + ]) + }, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ) + ) { + v = await this.#${property.singularName}_fromJsonLd( + inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: ${cachedPropertyBaseUrl}, + }, + ); + } } catch (error) { if (!options.suppressError) throw error; getLogger(["fedify", "vocab"]).debug( diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index d67b05d8f..03c1acbb1 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -66,7 +66,6 @@ type RawPropertyEncoder = ( interface RawPropertyDescriptor { readonly canonicalIri: string; readonly encode: RawPropertyEncoder; - readonly values: (object: object) => readonly unknown[]; } // Unknown properties retained while decoding, keyed by the decoded object: @@ -98,97 +97,88 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } -function isSameRawPropertyNode(source: unknown, destination: unknown): boolean { - if ( - source == null || destination == null || - typeof source !== "object" || typeof destination !== "object" || - !(RAW_PROPERTY_PROTOCOL in source) || !(RAW_PROPERTY_PROTOCOL in destination) - ) { - return false; - } - const sourceId = (source as unknown as { id: URL | null }).id; - const destinationId = (destination as unknown as { id: URL | null }).id; - return sourceId?.href === destinationId?.href; +// Embeds the context of a cached document in a document embedded in it, so +// that decoding the embedded document alone resolves its terms the same way +// as decoding the whole document did. Entries that the embedded document's +// own context repeats are left out, since applying them again later yields +// the same terms. Property-scoped contexts of the parent are not applied, as +// the embedded document is decoded as a top-level node: +function inheritJsonLdContext( + parentContext: unknown, + document: object, +): object { + const own = (document as { "@context"?: unknown })["@context"]; + const ownEntries = globalThis.Array.isArray(own) ? own : [own]; + const ownKeys = new Set( + ownEntries.map((entry) => globalThis.JSON.stringify(entry)), + ); + const context = [ + ...(globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]).filter((entry) => + !ownKeys.has(globalThis.JSON.stringify(entry)) + ), + ...ownEntries, + ]; + return { + ...document, + "@context": context.length === 1 ? context[0] : context, + }; } -function getRawPropertyDescriptors(object: object): Set { - const descriptors = new Set(); - let prototype: object | null = globalThis.Object.getPrototypeOf(object); - while (prototype != null) { - for (const descriptor of rawPropertyDescriptors.get(prototype)?.values() ?? []) { - descriptors.add(descriptor); - } - prototype = globalThis.Object.getPrototypeOf(prototype); - } - return descriptors; -} +// The property IRIs each key of a compacted document expands to, keyed by +// the document: +const expandedKeys = new WeakMap>>(); -// Merges the retained unknown properties of a decoded object into a copy that -// was decoded again by a different class. The classes classify properties -// differently, so the copy keeps what it retained itself and gains the -// original's values for the properties its own class does not know either: -function mergeRawProperties(source: object, destination: object): void { - const retained = retainedRawProperties.get(source); - if (retained == null) return; - const merged: Record = { - ...retainedRawProperties.get(destination), - }; - let changed = false; - for (const [iri, values] of globalThis.Object.entries(retained)) { - if (getRawPropertyDescriptor(destination, iri) != null) continue; - merged[iri] = values; - changed = true; - } - if (changed) { - retainedRawProperties.set( - destination, - globalThis.Object.freeze(merged) as RetainedRawProperties, - ); +function expandKey( + document: Record, + key: string, + contextLoader: DocumentLoader, +): Promise { + let keys = expandedKeys.get(document); + if (keys == null) { + keys = new Map(); + expandedKeys.set(document, keys); } + const cached = keys.get(key); + if (cached != null) return cached; + const iris = jsonld.expand( + { "@context": document["@context"], [key]: [] }, + { documentLoader: contextLoader, keepFreeFloatingNodes: true }, + ).then((expanded: unknown[]) => + globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => + !iri.startsWith("@") + ) + ); + // A failure, such as of the context loader, is not remembered, as another + // call can pass another loader: + const map = keys; + iris.catch(() => map.delete(key)); + keys.set(key, iris); + return iris; } -// Copies the retained unknown properties of a decoded object and of the -// objects nested in it to a copy of the same graph that was decoded again, -// pairing nested objects by property and position. Only objects with the same -// id are paired. When the decoding dropped some values of a property, -// positions no longer correspond, so nested objects are paired by id alone. -// When the copy was decoded by a different class, the retained properties are -// merged rather than replaced, and only the properties both classes declare, -// matched by their IRIs, are followed: -function copyRawPropertiesDeep( - source: object, - destination: object, - visited: Set = new Set(), -): void { - if (visited.has(destination)) return; - visited.add(destination); - if (!isSameRawPropertyNode(source, destination)) return; - const sameClass = globalThis.Object.getPrototypeOf(source) === - globalThis.Object.getPrototypeOf(destination); - if (sameClass) copyRawProperties(source, destination); - else mergeRawProperties(source, destination); - for (const descriptor of getRawPropertyDescriptors(destination)) { - // Sibling classes declare the same property with distinct descriptors, so - // each object is read through its own class's descriptor: - const sourceDescriptor = sameClass - ? descriptor - : getRawPropertyDescriptor(source, descriptor.canonicalIri); - if (sourceDescriptor == null) continue; - const sources = sourceDescriptor.values(source); - const destinations = descriptor.values(destination); - const aligned = sources.length === destinations.length; - for (let i = 0; i < destinations.length; i++) { - const destination = destinations[i]; - const source = aligned - ? sources[i] - : (destination as { id?: URL | null } | null)?.id == null - ? undefined - : sources.find((s) => isSameRawPropertyNode(s, destination)); - if (source !== destination && isSameRawPropertyNode(source, destination)) { - copyRawPropertiesDeep(source as object, destination as object, visited); - } - } - } +// Whether a compacted document maps the given key, and no other key, to +// a property, so that the embedded documents under the key are the values +// decoded for the property. A context can remap the key to another property +// or map another term to the property, in which case the cached documents +// cannot be matched with the decoded values: +async function isCachedPropertyKey( + document: Record, + key: string, + iris: readonly string[], + contextLoader: DocumentLoader, +): Promise { + const own = await expandKey(document, key, contextLoader); + if (own.length !== 1 || own[0] !== iris[0]) return false; + const others = await globalThis.Promise.all( + globalThis.Object.keys(document) + .filter((k) => k !== key && !k.startsWith("@")) + // Keyword aliases, such as id, cannot take an empty array, and are + // not properties anyway: + .map((k) => expandKey(document, k, contextLoader).catch(() => [])), + ); + return !others.flat().some((iri) => iris.includes(iri)); } async function readRawProperty( @@ -396,9 +386,6 @@ export async function* generateRawPropertyDescriptors( : "array" }; }, - values(object: object): readonly unknown[] { - return (object as ${type.name}).${await getFieldName(property.uri)}; - }, }; descriptors.set(${JSON.stringify(property.uri)}, descriptor); `; diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index 323f885c0..96a3baa40 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -10,7 +10,6 @@ import { Object as ASObject, Person, Question, - Service, } from "./mod.ts"; const AS = "https://www.w3.org/ns/activitystreams"; @@ -174,19 +173,27 @@ test("getRawPropertyValues() reads objects nested in reparsed embedded objects", ]); }); -test("getRawPropertyValues() does not mix up objects dropped by a reparse", async () => { +test("getRawPropertyValues() reads embedded objects that rely on the parent's context", async () => { + // Only the outer context defines these terms, and the embedded objects + // have their own contexts, so accessors decode them from the cache again: const create = await Create.fromJsonLd({ - "@context": [AS, { quant: QUANT, Doc: `${AS}#Document` }], + "@context": [AS, { + Doc: `${AS}#Document`, + Poll: `${AS}#Question`, + choices: `${AS}#oneOf`, + quant: QUANT, + }], id: "https://example.com/activities/1", type: "Create", actor: "https://example.com/users/alice", object: { "@context": AS, - id: "https://example.com/notes/1", - type: "Note", + id: "https://example.com/questions/1", + type: ["Poll", "Object"], + choices: [{ type: "Note", name: "Yes" }], + "quant:structuredUrl": { "@id": "https://example.com/data/1" }, attachment: [ { - // Only the outer context defines this type alias: type: "Doc", "quant:structuredUrl": { "@id": "https://example.com/data/a" }, }, @@ -197,82 +204,68 @@ test("getRawPropertyValues() does not mix up objects dropped by a reparse", asyn ], }, }); - const note = await create.getObject(); - ok(note instanceof Note); - const attachments = await Array.fromAsync(note.getAttachments()); - // Reparsed without the outer context, the first attachment is dropped: - strictEqual(attachments.length, 1); - ok(attachments[0] != null); - // Without an id to match, the remaining attachment cannot be paired with - // its original, so it must not receive the dropped attachment's values: + const question = await create.getObject(); + ok(question instanceof Question); deepStrictEqual( - await getRawPropertyValues(attachments[0], STRUCTURED_URL), - [], - ); -}); - -test("getRawPropertyValues() keeps unknown properties when a reparse changes the class", async () => { - const create = await Create.fromJsonLd({ - "@context": [AS, { Poll: `${AS}#Question`, quant: QUANT }], - id: "https://example.com/activities/1", - type: "Create", - actor: "https://example.com/users/alice", - object: { - "@context": AS, - id: "https://example.com/questions/1", - // Only the outer context defines this type alias and prefix: - type: ["Poll", "Object"], - oneOf: [{ type: "Note", name: "Yes" }], - "quant:structuredUrl": { "@id": "https://example.com/data/1" }, - attachment: { - type: "Document", - "quant:structuredUrl": { "@id": "https://example.com/data/2" }, - }, - }, - }); - const object = await create.getObject(); - ok(object != null); - ok(!(object instanceof Question)); - // Retained only by the reparse, as the original class knew it: - deepStrictEqual( - (await getRawPropertyValues(object, `${AS}#oneOf`)).length, - 1, + (await Array.fromAsync(question.getExclusiveOptions())).map((o) => + o.name?.toString() + ), + ["Yes"], ); - // Retained only by the original decode, which had the outer context: - deepStrictEqual(await getRawPropertyValues(object, STRUCTURED_URL), [ + deepStrictEqual(await getRawPropertyValues(question, STRUCTURED_URL), [ { "@id": "https://example.com/data/1" }, ]); - const [attachment] = await Array.fromAsync(object.getAttachments()); - ok(attachment != null); - deepStrictEqual(await getRawPropertyValues(attachment, STRUCTURED_URL), [ - { "@id": "https://example.com/data/2" }, - ]); + const attachments = await Array.fromAsync(question.getAttachments()); + deepStrictEqual(attachments.length, 2); + for (const [i, attachment] of attachments.entries()) { + ok(attachment != null); + deepStrictEqual(await getRawPropertyValues(attachment, STRUCTURED_URL), [ + { "@id": `https://example.com/data/${"ab"[i]}` }, + ]); + } }); -test("getRawPropertyValues() follows properties shared by sibling classes", async () => { - const create = await Create.fromJsonLd({ - "@context": [AS, { Human: `${AS}#Person`, quant: QUANT }], - id: "https://example.com/activities/1", - type: "Create", - actor: "https://example.com/users/alice", - object: { - "@context": AS, - id: "https://example.com/users/bot", - // Only the outer context defines this type alias and prefix: - type: ["Human", "Service"], - endpoints: { - sharedInbox: "https://example.com/inbox", - "quant:structuredUrl": { "@id": "https://example.com/data/1" }, +test("getRawPropertyValues() reads embedded objects under terms of the parent's context", async () => { + const note = await Note.fromJsonLd({ + "@context": [AS, { extra: `${AS}#attachment`, attachment: null }], + id: "https://example.com/notes/1", + type: "Note", + // The outer context ignores this term and maps another to as:attachment, + // so the cached documents under the default term are not the values: + attachment: [ + { + "@context": AS, + type: "Document", + name: "Ignored", + [STRUCTURED_URL]: { "@id": "https://example.com/data/0" }, }, - }, + ], + extra: [ + { + "@context": AS, + type: "Document", + name: "First", + [STRUCTURED_URL]: { "@id": "https://example.com/data/1" }, + }, + { + "@context": AS, + type: "Document", + name: "Second", + [STRUCTURED_URL]: { "@id": "https://example.com/data/2" }, + }, + ], }); - const actor = await create.getObject(); - ok(actor instanceof Service); - const endpoints = actor.endpoints; - ok(endpoints != null); - deepStrictEqual(await getRawPropertyValues(endpoints, STRUCTURED_URL), [ - { "@id": "https://example.com/data/1" }, + const attachments = await Array.fromAsync(note.getAttachments()); + deepStrictEqual(attachments.map((a) => a?.name?.toString()), [ + "First", + "Second", ]); + for (const [i, attachment] of attachments.entries()) { + ok(attachment != null); + deepStrictEqual(await getRawPropertyValues(attachment, STRUCTURED_URL), [ + { "@id": `https://example.com/data/${i + 1}` }, + ]); + } }); test("getRawPropertyValues() keeps unknown properties across copies", async () => { diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index a03840fd4..1d55e8f63 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -2234,7 +2234,14 @@ test({ function embeddedPropertyDocument(property: "attachment" | "object") { const context = "https://www.w3.org/ns/activitystreams"; return { - "@context": [context, { CustomImage: `${context}#Image` }], + "@context": [context, { + // A property-scoped context applies only while the whole document is + // decoded, so reparsing the cached embedded value alone fails: + [property]: { + "@id": `${context}#${property}`, + "@context": { CustomImage: `${context}#Image` }, + }, + }], type: property === "attachment" ? "Note" : "Create", [property]: [ { From f9e9d5fc44628e02cb7d9d23258cdb310b4c252d Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 5 Nov 2026 15:45:42 +0900 Subject: [PATCH 17/35] Bind only namespaces with values in IRI lint The previous change bound every TypeScript namespace name, but a namespace containing only interfaces and type aliases declares no value and does not shadow an outer binding. An imported helper called next to such a namespace of the same name then went unchecked. Namespaces are now bound only when they declare a value, including through nested namespaces. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4477250846 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 32 +++++++++++++++++-- .../tests/raw-property-iri-invalid.test.ts | 9 ++++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index f09dc9e9e..fdbfe4b5e 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -168,6 +168,32 @@ function toJsonString(raw: string): string | null { return result + '"'; } +/** + * Whether a TypeScript namespace declares a value, as opposed to containing + * only types. Only such a namespace shadows an outer value binding. + */ +function isInstantiated(node: Ast): boolean { + const body = ast(node.body); + if (body == null) return true; + if (body.type === "TSModuleDeclaration") return isInstantiated(body); + for (const statement of (body.body ?? []) as Ast[]) { + const declaration = statement.type === "ExportNamedDeclaration" + ? ast(statement.declaration) + : statement; + if (declaration == null) continue; + if ( + declaration.type === "TSInterfaceDeclaration" || + declaration.type === "TSTypeAliasDeclaration" || + (declaration.type === "TSModuleDeclaration" && + !isInstantiated(declaration)) + ) { + continue; + } + return true; + } + return false; +} + function lookup( scope: Scope | undefined, identifier: string, @@ -196,9 +222,9 @@ export function checkRawPropertyIris( if ( node.type === "FunctionDeclaration" || node.type === "ClassDeclaration" || - // Namespaces and enums also declare a value binding: - node.type === "TSModuleDeclaration" || - node.type === "TSEnumDeclaration" + // Enums and namespaces with values also declare a value binding: + node.type === "TSEnumDeclaration" || + (node.type === "TSModuleDeclaration" && isInstantiated(node)) ) { bind(node.id, outer); } diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index fa3ca3e28..8f1a8c6fb 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -202,6 +202,15 @@ cases.push( "enum shadows namespace import", 'import * as vocab from "@fedify/vocab"; enum vocab { getRawPropertyValue } vocab.getRawPropertyValue({}, "content");', ], + [ + "type-only namespace does not shadow", + `${setup} namespace Outer { namespace read { export interface X {} } read(obj, "content"); }`, + "must be a full", + ], + [ + "namespace with values shadows", + `${setup} namespace Outer { namespace read { export const x = 1; } read(obj, "content"); }`, + ], ["IPv6 authority", `${setup} read(obj, "https://[::1]/property");`], [ "escaped template", From c64ab91781e915c85645a9ea65d8a654d7d89534 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 5 Nov 2026 15:45:54 +0900 Subject: [PATCH 18/35] Scope enum members in IRI lint TypeScript enum initializers can refer to the enum's members by their bare names, which shadow outer bindings of the same names. The raw-property-iri-invalid rule resolved such names to the outer bindings, so a call in an initializer could be reported for a value it does not pass. Enums now get a scope holding their member names, and the rule also visits member initializers under Deno, whose AST exposes them only through getters. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4477318615 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 12 ++++++++++++ .../lint/src/tests/raw-property-iri-invalid.test.ts | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index fdbfe4b5e..3e0437abb 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -108,6 +108,8 @@ function children(node: Ast): Ast[] { "quasi", "quasis", "children", + "members", + "initializer", ]); for (const key of keys) { // ESTree providers attach the token and comment arrays to Program: @@ -239,6 +241,7 @@ export function checkRawPropertyIris( "ClassDeclaration", "StaticBlock", "TSModuleBlock", + "TSEnumDeclaration", ].includes(node.type); const scope: Scope = scoped ? { @@ -258,6 +261,15 @@ export function checkRawPropertyIris( bind(node.id, scope); } if (node.type === "CatchClause") bind(node.param, scope); + if (node.type === "TSEnumDeclaration") { + // Initializers can refer to members by their bare names: + const body = ast(node.body); + const members = (node.members ?? body?.members ?? []) as Ast[]; + for (const member of members) { + const id = name(member.id); + if (id != null) scope.bindings.set(id, {}); + } + } if (node.type === "ImportDeclaration") { const source = name(node.source); const included = source != null && ( diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index 8f1a8c6fb..85411f14e 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -211,6 +211,15 @@ cases.push( "namespace with values shadows", `${setup} namespace Outer { namespace read { export const x = 1; } read(obj, "content"); }`, ], + [ + "enum members shadow outer bindings", + `${setup} const iri = "content"; enum E { iri = "https://example/p", V = (read(obj, iri), 0) }`, + ], + [ + "enum initializers are checked", + `${setup} enum E { V = (read(obj, "content"), 0) }`, + "must be a full", + ], ["IPv6 authority", `${setup} read(obj, "https://[::1]/property");`], [ "escaped template", From afc31b448da9a12f5faf4d340effc8d9d707208c Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 5 Nov 2026 18:00:52 +0900 Subject: [PATCH 19/35] Validate IP literals in raw property IRIs The IRI syntax check for raw property lookups rejected square brackets after the authority, but accepted any bracketed text in the authority, so an IRI such as https://[abc]/x was looked up instead of throwing a TypeError. Brackets must now enclose the whole host and delimit an IPv6 address or an IPvFuture literal, as RFC 3986 requires, and may not appear in the userinfo. The raw-property-iri-invalid lint rule applies the same check. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4478183751 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 22 +++++++++++++++++++ .../tests/raw-property-iri-invalid.test.ts | 7 ++++++ .../src/internal/raw-property.test.ts | 14 ++++++++++++ .../src/internal/raw-property.ts | 22 +++++++++++++++++++ 4 files changed, 65 insertions(+) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 3e0437abb..b69bebdb7 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -170,6 +170,25 @@ function toJsonString(raw: string): string | null { return result + '"'; } +const IP_LITERAL_PATTERN = /^\[([^\[\]]*)\](?::[0-9]*)?$/; +const IP_FUTURE_PATTERN = /^v[0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+$/i; + +/** + * Checks that square brackets in an authority delimit an IPv6 address or an + * IPvFuture literal as the whole host, as the runtime does. + */ +function isAuthoritySyntax(authority: string): boolean { + const hostPort = authority.slice(authority.lastIndexOf("@") + 1); + const userinfo = authority.slice(0, authority.length - hostPort.length); + if (/[[\]]/.test(userinfo)) return false; + if (!/[[\]]/.test(hostPort)) return true; + const match = IP_LITERAL_PATTERN.exec(hostPort); + if (match == null) return false; + const literal = match[1]; + return IP_FUTURE_PATTERN.test(literal) || + URL.canParse(`http://[${literal}]/`); +} + /** * Whether a TypeScript namespace declares a value, as opposed to containing * only types. Only such a namespace shadows an outer value binding. @@ -378,14 +397,17 @@ export function checkRawPropertyIris( const scheme = /^([A-Za-z][A-Za-z0-9+.-]*):/.exec(value); const rest = scheme == null ? "" : value.slice(scheme[0].length); let path = rest; + let authority = ""; if (rest.startsWith("//")) { const end = rest.slice(2).search(/[/?#]/); + authority = end < 0 ? rest.slice(2) : rest.slice(2, 2 + end); path = end < 0 ? "" : rest.slice(2 + end); } // These checks follow the raw-property API's IRI syntax contract, rather // than WHATWG URL parsing (which normalizes spaces and malformed escapes). if ( !scheme || rest === "" || value.startsWith("_:") || + !isAuthoritySyntax(authority) || path.includes("[") || path.includes("]") || /["<>\\^`{|}]/u.test(value) || Array.from(value).some((char) => { diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index 85411f14e..5eef6467b 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -13,6 +13,8 @@ const cases: [string, string, string?][] = [ "", "as:", "https://example/path[0]", + "https://[abc]/x", + "https://a[::1]/x", "https://example/\ud800", "@id", "_:node", @@ -221,6 +223,11 @@ cases.push( "must be a full", ], ["IPv6 authority", `${setup} read(obj, "https://[::1]/property");`], + [ + "IPvFuture authority", + `${setup} read(obj, "urn://[v1.fe80::a+en1]/p");`, + "non-HTTP scheme", + ], [ "escaped template", `${setup} read(obj, \`con\\u0074ent\`);`, diff --git a/packages/vocab-runtime/src/internal/raw-property.test.ts b/packages/vocab-runtime/src/internal/raw-property.test.ts index 65d007831..51fe01dab 100644 --- a/packages/vocab-runtime/src/internal/raw-property.test.ts +++ b/packages/vocab-runtime/src/internal/raw-property.test.ts @@ -30,6 +30,13 @@ test("parseRawPropertyIri() accepts absolute IRIs", () => { deepStrictEqual(parseRawPropertyIri("https://[::1]/ns#prop", "f"), [ "https://[::1]/ns#prop", ]); + deepStrictEqual( + parseRawPropertyIri("https://user@[2001:db8::1]:8080/ns#prop", "f"), + ["https://user@[2001:db8::1]:8080/ns#prop"], + ); + deepStrictEqual(parseRawPropertyIri("urn://[v1.fe80::a+en1]/p", "f"), [ + "urn://[v1.fe80::a+en1]/p", + ]); deepStrictEqual(parseRawPropertyIri("urn:example:prop", "f"), [ "urn:example:prop", ]); @@ -55,6 +62,13 @@ test("parseRawPropertyIri() rejects what is not an absolute IRI", () => { "https://example.com/%2", "https://example.com/#a#b", "https://example.com/[a]", + "https://[abc]/x", + "https://[::1/x", + "https://::1]/x", + "https://[::1]x/y", + "https://a[::1]/x", + "https://[u@]::1]/x", + "https://[v1]/x", "https://example.com/\uD800", ] ) { diff --git a/packages/vocab-runtime/src/internal/raw-property.ts b/packages/vocab-runtime/src/internal/raw-property.ts index f1a846533..1d96d6a08 100644 --- a/packages/vocab-runtime/src/internal/raw-property.ts +++ b/packages/vocab-runtime/src/internal/raw-property.ts @@ -346,11 +346,33 @@ function isIriSyntax(rest: string): boolean { let path = rest; if (rest.startsWith("//")) { const end = rest.slice(2).search(/[/?#]/); + const authority = end < 0 ? rest.slice(2) : rest.slice(2, 2 + end); + if (!isAuthoritySyntax(authority)) return false; path = end < 0 ? "" : rest.slice(2 + end); } return !path.includes("[") && !path.includes("]"); } +const IP_LITERAL_PATTERN = /^\[([^\[\]]*)\](?::[0-9]*)?$/; +const IP_FUTURE_PATTERN = /^v[0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+$/i; + +/** + * Checks that square brackets in an authority delimit an IPv6 address or an + * IPvFuture literal as the whole host, as RFC 3986 requires. + */ +function isAuthoritySyntax(authority: string): boolean { + const hostPort = authority.slice(authority.lastIndexOf("@") + 1); + const userinfo = authority.slice(0, authority.length - hostPort.length); + if (/[[\]]/.test(userinfo)) return false; + if (!/[[\]]/.test(hostPort)) return true; + const match = IP_LITERAL_PATTERN.exec(hostPort); + if (match == null) return false; + const literal = match[1]; + return IP_FUTURE_PATTERN.test(literal) || + // The WHATWG URL parser accepts IPv6 addresses, but not IPvFuture: + URL.canParse(`http://[${literal}]/`); +} + /** * Implements the `getRawPropertyValues()` function generated into every * vocabulary module. From cfb759cdb63e38ae6907424cd5ba7839070320e1 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 5 Nov 2026 18:02:38 +0900 Subject: [PATCH 20/35] Handle import aliases in IRI lint scopes TypeScript import aliases, such as import iri = M.iri, declare a value binding, but the raw-property-iri-invalid rule did not collect them. A call reading such an alias was therefore checked against an outer const of the same name. On the other hand, a namespace whose only contents were non-exported import aliases was treated as declaring a value, so it hid an imported helper of the same name. Import aliases now bind their names, and non-exported ones no longer make a namespace a value. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4477486176 https://github.com/fedify-dev/fedify/pull/1356#discussion_r4477502190 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 6 ++++++ packages/lint/src/tests/raw-property-iri-invalid.test.ts | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index b69bebdb7..01ec8d61d 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -203,6 +203,9 @@ function isInstantiated(node: Ast): boolean { : statement; if (declaration == null) continue; if ( + // A non-exported import alias does not make a namespace a value: + (statement.type === "TSImportEqualsDeclaration" && + statement.isExport !== true) || declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || (declaration.type === "TSModuleDeclaration" && @@ -280,6 +283,9 @@ export function checkRawPropertyIris( bind(node.id, scope); } if (node.type === "CatchClause") bind(node.param, scope); + // An import alias, such as import iri = M.iri, binds a value that is + // not statically known here: + if (node.type === "TSImportEqualsDeclaration") bind(node.id, scope); if (node.type === "TSEnumDeclaration") { // Initializers can refer to members by their bare names: const body = ast(node.body); diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index 5eef6467b..90cc1f88a 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -213,6 +213,15 @@ cases.push( "namespace with values shadows", `${setup} namespace Outer { namespace read { export const x = 1; } read(obj, "content"); }`, ], + [ + "namespace with only an import alias does not shadow", + `${setup} namespace Outer { namespace read { import X = Outer.Y; } read(obj, "content"); }`, + "must be a full", + ], + [ + "import alias shadows outer bindings", + `${setup} const iri = "content"; namespace M { export const iri = "https://example/p"; } namespace N { import iri = M.iri; read(obj, iri); }`, + ], [ "enum members shadow outer bindings", `${setup} const iri = "content"; enum E { iri = "https://example/p", V = (read(obj, iri), 0) }`, From e089cb746f70c764930fefaa2ff5ecd8bd4782f5 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 5 Nov 2026 18:21:55 +0900 Subject: [PATCH 21/35] Reference the issue in embedded context entries The changelog entries for the embedded object context fix named only the pull request, while each entry must reference both the issue and the pull request. The fix came out of the review of the raw property work for https://github.com/fedify-dev/fedify/issues/1272, so the entries now reference that issue. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4477431107 https://github.com/fedify-dev/fedify/pull/1356#discussion_r4477431113 Assisted-by: Claude Code:claude-opus-5-5 --- CHANGES.md | 4 ++-- changes.d/vocab-tools/embedded-object-context.md | 3 ++- changes.d/vocab/embedded-object-context.md | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f6b5b881e..642c29bbf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -369,7 +369,7 @@ To be released. whole document when the cached JSON-LD cannot be matched with it. The `toJsonLd()` result of such an embedded object now also includes the entries of the enclosing context that its own context does not repeat, - so it means the same when used on its own. [[#1356]] + so it means the same when used on its own. [[#1272], [#1356]] [FEP-6757]: https://w3id.org/fep/6757 [#1212]: https://github.com/fedify-dev/fedify/issues/1212 @@ -424,7 +424,7 @@ To be released. `@context` without the enclosing document's context, which could return objects of another class, drop property values, or pick objects under a term the enclosing context mapped to another property. - [[#1356]] + [[#1272], [#1356]] - Generated vocabulary modules now export `getRawPropertyValues()` and `getRawPropertyValue()`, which read any property of a generated object by its full IRI, and their root classes implement `VocabularyObject` from diff --git a/changes.d/vocab-tools/embedded-object-context.md b/changes.d/vocab-tools/embedded-object-context.md index 8e47f3450..e97e1dea7 100644 --- a/changes.d/vocab-tools/embedded-object-context.md +++ b/changes.d/vocab-tools/embedded-object-context.md @@ -1,9 +1,10 @@ --- links: + '#1272': https://github.com/fedify-dev/fedify/issues/1272 '#1356': https://github.com/fedify-dev/fedify/pull/1356 --- - Fixed generated accessors decoding embedded objects that have their own `@context` without the enclosing document's context, which could return objects of another class, drop property values, or pick objects under a term the enclosing context mapped to another property. - [[#1356]] + [[#1272], [#1356]] diff --git a/changes.d/vocab/embedded-object-context.md b/changes.d/vocab/embedded-object-context.md index 2b94ac5ae..84a01fc85 100644 --- a/changes.d/vocab/embedded-object-context.md +++ b/changes.d/vocab/embedded-object-context.md @@ -1,5 +1,6 @@ --- links: + '#1272': https://github.com/fedify-dev/fedify/issues/1272 '#1356': https://github.com/fedify-dev/fedify/pull/1356 --- - Fixed accessors of objects decoded by `fromJsonLd()` returning wrong @@ -13,4 +14,4 @@ links: whole document when the cached JSON-LD cannot be matched with it. The `toJsonLd()` result of such an embedded object now also includes the entries of the enclosing context that its own context does not repeat, - so it means the same when used on its own. [[#1356]] + so it means the same when used on its own. [[#1272], [#1356]] From 26bffc6d07dbb0d30c9a2d94502b58fd0b2af00b Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 5 Nov 2026 18:22:47 +0900 Subject: [PATCH 22/35] Keep the parent context order for embedded objects When an accessor decoded a cached embedded object, it dropped the parent's context entries that the embedded object's own context repeated. That could move a parent entry ahead of the entry defining a term it refers to: with a parent context of [AS, { Alias: "Note" }] and an embedded AS context, the result [{ Alias: "Note" }, AS] failed to expand. The parent's entries now keep their order and come before the embedded object's own context. Only when the own context already begins with all of the parent's entries is it used as is, which keeps the common case of a repeated ActivityStreams context unchanged. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4477502186 Assisted-by: Claude Code:claude-opus-5-5 --- CHANGES.md | 5 ++- changes.d/vocab/embedded-object-context.md | 5 ++- .../src/__snapshots__/class.test.ts.deno.snap | 38 +++++++++---------- .../src/__snapshots__/class.test.ts.node.snap | 38 +++++++++---------- .../src/__snapshots__/class.test.ts.snap | 38 +++++++++---------- packages/vocab-tools/src/raw-property.ts | 38 +++++++++---------- packages/vocab/src/raw-property.test.ts | 22 +++++++++++ 7 files changed, 104 insertions(+), 80 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 642c29bbf..250cea8ee 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -368,8 +368,9 @@ To be released. apply the enclosing context and fall back to the object decoded with the whole document when the cached JSON-LD cannot be matched with it. The `toJsonLd()` result of such an embedded object now also includes the - entries of the enclosing context that its own context does not repeat, - so it means the same when used on its own. [[#1272], [#1356]] + enclosing context in front of its own, unless its own context already + begins with it, so it means the same when used on its own. + [[#1272], [#1356]] [FEP-6757]: https://w3id.org/fep/6757 [#1212]: https://github.com/fedify-dev/fedify/issues/1212 diff --git a/changes.d/vocab/embedded-object-context.md b/changes.d/vocab/embedded-object-context.md index 84a01fc85..20a3de108 100644 --- a/changes.d/vocab/embedded-object-context.md +++ b/changes.d/vocab/embedded-object-context.md @@ -13,5 +13,6 @@ links: apply the enclosing context and fall back to the object decoded with the whole document when the cached JSON-LD cannot be matched with it. The `toJsonLd()` result of such an embedded object now also includes the - entries of the enclosing context that its own context does not repeat, - so it means the same when used on its own. [[#1272], [#1356]] + enclosing context in front of its own, unless its own context already + begins with it, so it means the same when used on its own. + [[#1272], [#1356]] diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 5bf545b9c..b4ebc8ea0 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -422,31 +422,31 @@ function copyRawProperties(source: object, destination: object): void { // Embeds the context of a cached document in a document embedded in it, so // that decoding the embedded document alone resolves its terms the same way -// as decoding the whole document did. Entries that the embedded document's -// own context repeats are left out, since applying them again later yields -// the same terms. Property-scoped contexts of the parent are not applied, as -// the embedded document is decoded as a top-level node: +// as decoding the whole document did. The parent's context entries keep +// their order, as later entries can refer to terms earlier ones define. +// When the embedded document's own context already begins with all of them, +// it is used as is, since applying the same entries again yields the same +// terms. Property-scoped contexts of the parent are not applied, as the +// embedded document is decoded as a top-level node: function inheritJsonLdContext( parentContext: unknown, document: object, ): object { const own = (document as { \\"@context\\"?: unknown })[\\"@context\\"]; const ownEntries = globalThis.Array.isArray(own) ? own : [own]; - const ownKeys = new Set( - ownEntries.map((entry) => globalThis.JSON.stringify(entry)), - ); - const context = [ - ...(globalThis.Array.isArray(parentContext) - ? parentContext - : [parentContext]).filter((entry) => - !ownKeys.has(globalThis.JSON.stringify(entry)) - ), - ...ownEntries, - ]; - return { - ...document, - \\"@context\\": context.length === 1 ? context[0] : context, - }; + const parentEntries = globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]; + if ( + parentEntries.length <= ownEntries.length && + parentEntries.every((entry, i) => + globalThis.JSON.stringify(entry) === + globalThis.JSON.stringify(ownEntries[i]) + ) + ) { + return document; + } + return { ...document, \\"@context\\": [...parentEntries, ...ownEntries] }; } // The property IRIs each key of a compacted document expands to, keyed by diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 7de23ca59..10bb39baf 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -420,31 +420,31 @@ function copyRawProperties(source: object, destination: object): void { // Embeds the context of a cached document in a document embedded in it, so // that decoding the embedded document alone resolves its terms the same way -// as decoding the whole document did. Entries that the embedded document's -// own context repeats are left out, since applying them again later yields -// the same terms. Property-scoped contexts of the parent are not applied, as -// the embedded document is decoded as a top-level node: +// as decoding the whole document did. The parent's context entries keep +// their order, as later entries can refer to terms earlier ones define. +// When the embedded document's own context already begins with all of them, +// it is used as is, since applying the same entries again yields the same +// terms. Property-scoped contexts of the parent are not applied, as the +// embedded document is decoded as a top-level node: function inheritJsonLdContext( parentContext: unknown, document: object, ): object { const own = (document as { \\"@context\\"?: unknown })[\\"@context\\"]; const ownEntries = globalThis.Array.isArray(own) ? own : [own]; - const ownKeys = new Set( - ownEntries.map((entry) => globalThis.JSON.stringify(entry)), - ); - const context = [ - ...(globalThis.Array.isArray(parentContext) - ? parentContext - : [parentContext]).filter((entry) => - !ownKeys.has(globalThis.JSON.stringify(entry)) - ), - ...ownEntries, - ]; - return { - ...document, - \\"@context\\": context.length === 1 ? context[0] : context, - }; + const parentEntries = globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]; + if ( + parentEntries.length <= ownEntries.length && + parentEntries.every((entry, i) => + globalThis.JSON.stringify(entry) === + globalThis.JSON.stringify(ownEntries[i]) + ) + ) { + return document; + } + return { ...document, \\"@context\\": [...parentEntries, ...ownEntries] }; } // The property IRIs each key of a compacted document expands to, keyed by diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 7d4474171..9d7793d3a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -422,31 +422,31 @@ function copyRawProperties(source: object, destination: object): void { // Embeds the context of a cached document in a document embedded in it, so // that decoding the embedded document alone resolves its terms the same way -// as decoding the whole document did. Entries that the embedded document's -// own context repeats are left out, since applying them again later yields -// the same terms. Property-scoped contexts of the parent are not applied, as -// the embedded document is decoded as a top-level node: +// as decoding the whole document did. The parent's context entries keep +// their order, as later entries can refer to terms earlier ones define. +// When the embedded document's own context already begins with all of them, +// it is used as is, since applying the same entries again yields the same +// terms. Property-scoped contexts of the parent are not applied, as the +// embedded document is decoded as a top-level node: function inheritJsonLdContext( parentContext: unknown, document: object, ): object { const own = (document as { "@context"?: unknown })["@context"]; const ownEntries = globalThis.Array.isArray(own) ? own : [own]; - const ownKeys = new Set( - ownEntries.map((entry) => globalThis.JSON.stringify(entry)), - ); - const context = [ - ...(globalThis.Array.isArray(parentContext) - ? parentContext - : [parentContext]).filter((entry) => - !ownKeys.has(globalThis.JSON.stringify(entry)) - ), - ...ownEntries, - ]; - return { - ...document, - "@context": context.length === 1 ? context[0] : context, - }; + const parentEntries = globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]; + if ( + parentEntries.length <= ownEntries.length && + parentEntries.every((entry, i) => + globalThis.JSON.stringify(entry) === + globalThis.JSON.stringify(ownEntries[i]) + ) + ) { + return document; + } + return { ...document, "@context": [...parentEntries, ...ownEntries] }; } // The property IRIs each key of a compacted document expands to, keyed by diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index 03c1acbb1..45b8d0ae6 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -99,31 +99,31 @@ function copyRawProperties(source: object, destination: object): void { // Embeds the context of a cached document in a document embedded in it, so // that decoding the embedded document alone resolves its terms the same way -// as decoding the whole document did. Entries that the embedded document's -// own context repeats are left out, since applying them again later yields -// the same terms. Property-scoped contexts of the parent are not applied, as -// the embedded document is decoded as a top-level node: +// as decoding the whole document did. The parent's context entries keep +// their order, as later entries can refer to terms earlier ones define. +// When the embedded document's own context already begins with all of them, +// it is used as is, since applying the same entries again yields the same +// terms. Property-scoped contexts of the parent are not applied, as the +// embedded document is decoded as a top-level node: function inheritJsonLdContext( parentContext: unknown, document: object, ): object { const own = (document as { "@context"?: unknown })["@context"]; const ownEntries = globalThis.Array.isArray(own) ? own : [own]; - const ownKeys = new Set( - ownEntries.map((entry) => globalThis.JSON.stringify(entry)), - ); - const context = [ - ...(globalThis.Array.isArray(parentContext) - ? parentContext - : [parentContext]).filter((entry) => - !ownKeys.has(globalThis.JSON.stringify(entry)) - ), - ...ownEntries, - ]; - return { - ...document, - "@context": context.length === 1 ? context[0] : context, - }; + const parentEntries = globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]; + if ( + parentEntries.length <= ownEntries.length && + parentEntries.every((entry, i) => + globalThis.JSON.stringify(entry) === + globalThis.JSON.stringify(ownEntries[i]) + ) + ) { + return document; + } + return { ...document, "@context": [...parentEntries, ...ownEntries] }; } // The property IRIs each key of a compacted document expands to, keyed by diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index 96a3baa40..f56e0d4ca 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -225,6 +225,28 @@ test("getRawPropertyValues() reads embedded objects that rely on the parent's co } }); +test("embedded objects keep the order of the parent's context", async () => { + const create = await Create.fromJsonLd({ + // The second entry refers to a term the first one defines: + "@context": [AS, { Alias: "Note", quant: QUANT }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": AS, + id: "https://example.com/notes/1", + type: "Alias", + content: "Hello", + "quant:structuredUrl": { "@id": "https://example.com/data/1" }, + }, + }); + const note = await create.getObject(); + ok(note instanceof Note); + deepStrictEqual(await getRawPropertyValues(note, STRUCTURED_URL), [ + { "@id": "https://example.com/data/1" }, + ]); +}); + test("getRawPropertyValues() reads embedded objects under terms of the parent's context", async () => { const note = await Note.fromJsonLd({ "@context": [AS, { extra: `${AS}#attachment`, attachment: null }], From 2fff19732ab570dace8ee2181365187fb04bc23c Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 6 Nov 2026 12:04:25 +0900 Subject: [PATCH 23/35] Keep decoded objects under non-propagating contexts A context whose first entry sets @propagate to false does not apply to embedded nodes, so prepending it when an accessor decodes a cached embedded object activated terms that the whole-document decode had left out. The accessor now keeps the object decoded with the whole document in that case, since the context it was decoded with cannot be rebuilt. Only the first entry is checked, as JSON-LD processors honor @propagate only there. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4478871373 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 21 ++++++++++++++----- .../src/__snapshots__/class.test.ts.node.snap | 21 ++++++++++++++----- .../src/__snapshots__/class.test.ts.snap | 21 ++++++++++++++----- packages/vocab-tools/src/raw-property.ts | 21 ++++++++++++++----- packages/vocab/src/raw-property.test.ts | 21 +++++++++++++++++++ 5 files changed, 85 insertions(+), 20 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index b4ebc8ea0..133ea8071 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -481,17 +481,28 @@ function expandKey( return iris; } -// Whether a compacted document maps the given key, and no other key, to -// a property, so that the embedded documents under the key are the values -// decoded for the property. A context can remap the key to another property -// or map another term to the property, in which case the cached documents -// cannot be matched with the decoded values: +// Whether the embedded documents under a key of a compacted document can be +// decoded again in place of the values decoded for a property. The document +// has to map the key, and no other key, to the property, as a context can +// remap the key or map another term to the property, in which case the cached +// documents cannot be matched with the decoded values. An inline context +// that does not propagate to embedded nodes, which only the first entry can +// declare, rules it out as well, since the context the embedded documents +// were decoded with cannot be rebuilt: async function isCachedPropertyKey( document: Record, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { + const context = document[\\"@context\\"]; + const first = globalThis.Array.isArray(context) ? context[0] : context; + if ( + first != null && typeof first === \\"object\\" && + (first as Record)[\\"@propagate\\"] === false + ) { + return false; + } const own = await expandKey(document, key, contextLoader); if (own.length !== 1 || own[0] !== iris[0]) return false; const others = await globalThis.Promise.all( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 10bb39baf..22c6fb5d9 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -479,17 +479,28 @@ function expandKey( return iris; } -// Whether a compacted document maps the given key, and no other key, to -// a property, so that the embedded documents under the key are the values -// decoded for the property. A context can remap the key to another property -// or map another term to the property, in which case the cached documents -// cannot be matched with the decoded values: +// Whether the embedded documents under a key of a compacted document can be +// decoded again in place of the values decoded for a property. The document +// has to map the key, and no other key, to the property, as a context can +// remap the key or map another term to the property, in which case the cached +// documents cannot be matched with the decoded values. An inline context +// that does not propagate to embedded nodes, which only the first entry can +// declare, rules it out as well, since the context the embedded documents +// were decoded with cannot be rebuilt: async function isCachedPropertyKey( document: Record, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { + const context = document[\\"@context\\"]; + const first = globalThis.Array.isArray(context) ? context[0] : context; + if ( + first != null && typeof first === \\"object\\" && + (first as Record)[\\"@propagate\\"] === false + ) { + return false; + } const own = await expandKey(document, key, contextLoader); if (own.length !== 1 || own[0] !== iris[0]) return false; const others = await globalThis.Promise.all( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 9d7793d3a..f6a4f62f6 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -481,17 +481,28 @@ function expandKey( return iris; } -// Whether a compacted document maps the given key, and no other key, to -// a property, so that the embedded documents under the key are the values -// decoded for the property. A context can remap the key to another property -// or map another term to the property, in which case the cached documents -// cannot be matched with the decoded values: +// Whether the embedded documents under a key of a compacted document can be +// decoded again in place of the values decoded for a property. The document +// has to map the key, and no other key, to the property, as a context can +// remap the key or map another term to the property, in which case the cached +// documents cannot be matched with the decoded values. An inline context +// that does not propagate to embedded nodes, which only the first entry can +// declare, rules it out as well, since the context the embedded documents +// were decoded with cannot be rebuilt: async function isCachedPropertyKey( document: Record, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { + const context = document["@context"]; + const first = globalThis.Array.isArray(context) ? context[0] : context; + if ( + first != null && typeof first === "object" && + (first as Record)["@propagate"] === false + ) { + return false; + } const own = await expandKey(document, key, contextLoader); if (own.length !== 1 || own[0] !== iris[0]) return false; const others = await globalThis.Promise.all( diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index 45b8d0ae6..b5a53c65a 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -158,17 +158,28 @@ function expandKey( return iris; } -// Whether a compacted document maps the given key, and no other key, to -// a property, so that the embedded documents under the key are the values -// decoded for the property. A context can remap the key to another property -// or map another term to the property, in which case the cached documents -// cannot be matched with the decoded values: +// Whether the embedded documents under a key of a compacted document can be +// decoded again in place of the values decoded for a property. The document +// has to map the key, and no other key, to the property, as a context can +// remap the key or map another term to the property, in which case the cached +// documents cannot be matched with the decoded values. An inline context +// that does not propagate to embedded nodes, which only the first entry can +// declare, rules it out as well, since the context the embedded documents +// were decoded with cannot be rebuilt: async function isCachedPropertyKey( document: Record, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { + const context = document["@context"]; + const first = globalThis.Array.isArray(context) ? context[0] : context; + if ( + first != null && typeof first === "object" && + (first as Record)["@propagate"] === false + ) { + return false; + } const own = await expandKey(document, key, contextLoader); if (own.length !== 1 || own[0] !== iris[0]) return false; const others = await globalThis.Promise.all( diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index f56e0d4ca..6fd210a9a 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -247,6 +247,27 @@ test("embedded objects keep the order of the parent's context", async () => { ]); }); +test("embedded objects do not inherit non-propagating contexts", async () => { + const create = await Create.fromJsonLd({ + // Only the first entry of a context can declare this: + "@context": [{ "@propagate": false, body: `${AS}#content` }, AS], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": AS, + id: "https://example.com/notes/1", + type: "Note", + // The term is out of scope here, so this is not the content: + body: "Not the content", + content: "Hello", + }, + }); + const note = await create.getObject(); + ok(note instanceof Note); + deepStrictEqual(note.contents, ["Hello"]); +}); + test("getRawPropertyValues() reads embedded objects under terms of the parent's context", async () => { const note = await Note.fromJsonLd({ "@context": [AS, { extra: `${AS}#attachment`, attachment: null }], From 0a8cf222b0a7c27a36c42a9e1f6169c41b261033 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 6 Nov 2026 12:05:01 +0900 Subject: [PATCH 24/35] Stop following outer constants from merged scopes TypeScript merges repeated namespace and enum declarations, so an exported member of another declaration can shadow an outer constant inside a namespace or enum body. The raw-property-iri-invalid rule followed the outer constant and reported a value the call does not pass. Rather than tracking members across declarations, the rule no longer follows a const binding out of a namespace or enum scope. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4478871388 Assisted-by: Claude Code:claude-opus-5-5 --- docs/manual/lint.md | 4 +++- packages/lint/src/lib/raw-property-iri.ts | 21 ++++++++++++++++++- .../tests/raw-property-iri-invalid.test.ts | 8 +++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/manual/lint.md b/docs/manual/lint.md index 9e63f1082..867915104 100644 --- a/docs/manual/lint.md +++ b/docs/manual/lint.md @@ -1815,7 +1815,9 @@ The rule checks string literals, templates without expressions, `const` bindings to those, and global `new URL("…")` calls without a base argument. Dynamic values, `new URL(relative, base)`, and `URL` objects bound to a variable are ignored, since a `URL` object can be changed after it is -constructed. +constructed. Inside a TypeScript namespace or enum, `const` bindings declared +outside of it are ignored too, since another declaration of the same namespace +or enum can shadow them. By default, only imports from `@fedify/vocab` are inspected, including `jsr:`/`npm:` and versioned specifiers. The deprecated diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 01ec8d61d..f0fcca13e 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -24,6 +24,8 @@ interface Binding { interface Scope { parent?: Scope; functionScope: boolean; + /** Whether declarations merged from elsewhere can add to this scope. */ + mergeable?: boolean; bindings: Map; } @@ -227,6 +229,21 @@ function lookup( } } +/** + * Looks up a binding to follow for its value. Another declaration of the same + * namespace or enum can export a member that shadows an outer binding, so + * the lookup does not leave such a scope. + */ +function lookupConstant( + scope: Scope | undefined, + identifier: string, +): Binding | undefined { + for (; scope; scope = scope.parent) { + if (scope.bindings.has(identifier)) return scope.bindings.get(identifier); + if (scope.mergeable) return undefined; + } +} + /** * Analyze a complete program after collecting lexical bindings, including * declarations that shadow imports before their textual declaration. @@ -271,6 +288,8 @@ export function checkRawPropertyIris( // A TypeScript namespace body is compiled to a function body: functionScope: isFunction || node.type === "StaticBlock" || node.type === "TSModuleBlock", + mergeable: node.type === "TSModuleBlock" || + node.type === "TSEnumDeclaration", bindings: new Map(), } : outer; @@ -374,7 +393,7 @@ export function checkRawPropertyIris( } if (node.type === "Identifier") { return staticString( - lookup(scopes.get(node), node.name as string)?.init, + lookupConstant(scopes.get(node), node.name as string)?.init, seen, true, ); diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index 90cc1f88a..f44d7057a 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -222,6 +222,14 @@ cases.push( "import alias shadows outer bindings", `${setup} const iri = "content"; namespace M { export const iri = "https://example/p"; } namespace N { import iri = M.iri; read(obj, iri); }`, ], + [ + "merged namespace members hide outer bindings", + `${setup} const iri = "content"; namespace N { export const iri = "https://example/p"; } namespace N { read(obj, iri); }`, + ], + [ + "merged enum members hide outer bindings", + `${setup} const iri = "content"; enum E { iri = "https://example/p" } enum E { V = (read(obj, iri), 0) }`, + ], [ "enum members shadow outer bindings", `${setup} const iri = "content"; enum E { iri = "https://example/p", V = (read(obj, iri), 0) }`, From ecefc1a6dbd7f02dc98a24219ac8a0295623f1f6 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 6 Nov 2026 16:03:22 +0900 Subject: [PATCH 25/35] Check embedded contexts for non-propagation too An embedded object's own context can start with an entry that sets @propagate to false. Prepending the parent's context moved that entry away from the first position, where processors honor it, so its terms leaked into objects nested in the embedded object. The accessor now keeps the object decoded with the whole document in this case as well. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4488661174 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 207 +++++++++++++++++- .../src/__snapshots__/class.test.ts.node.snap | 207 +++++++++++++++++- .../src/__snapshots__/class.test.ts.snap | 207 +++++++++++++++++- packages/vocab-tools/src/property.ts | 2 + packages/vocab-tools/src/raw-property.ts | 20 +- packages/vocab/src/raw-property.test.ts | 26 +++ 6 files changed, 641 insertions(+), 28 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 133ea8071..1bb65a9e2 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -481,25 +481,31 @@ function expandKey( return iris; } +// Only the first entry of a context can declare that it does not propagate: +function isNonPropagatingContext(context: unknown): boolean { + const first = globalThis.Array.isArray(context) ? context[0] : context; + return first != null && typeof first === \\"object\\" && + (first as Record)[\\"@propagate\\"] === false; +} + // Whether the embedded documents under a key of a compacted document can be // decoded again in place of the values decoded for a property. The document // has to map the key, and no other key, to the property, as a context can // remap the key or map another term to the property, in which case the cached // documents cannot be matched with the decoded values. An inline context -// that does not propagate to embedded nodes, which only the first entry can -// declare, rules it out as well, since the context the embedded documents -// were decoded with cannot be rebuilt: +// that does not propagate to embedded nodes, in the document or in the +// embedded document, rules it out as well, since prepending another context +// cannot rebuild the contexts they were decoded with: async function isCachedPropertyKey( document: Record, + embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { - const context = document[\\"@context\\"]; - const first = globalThis.Array.isArray(context) ? context[0] : context; if ( - first != null && typeof first === \\"object\\" && - (first as Record)[\\"@propagate\\"] === false + isNonPropagatingContext(document[\\"@context\\"]) || + isNonPropagatingContext((embedded as { \\"@context\\"?: unknown })[\\"@context\\"]) ) { return false; } @@ -6427,6 +6433,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"attachment\\", [\\"https://www.w3.org/ns/activitystreams#attachment\\"], options.contextLoader ?? this._contextLoader ?? @@ -6923,6 +6930,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -7100,6 +7108,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -7535,6 +7544,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], options.contextLoader ?? this._contextLoader ?? @@ -7711,6 +7721,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], options.contextLoader ?? this._contextLoader ?? @@ -8199,6 +8210,7 @@ get contents(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"context\\", [\\"https://www.w3.org/ns/activitystreams#context\\"], options.contextLoader ?? this._contextLoader ?? @@ -8694,6 +8706,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"generator\\", [\\"https://www.w3.org/ns/activitystreams#generator\\"], options.contextLoader ?? this._contextLoader ?? @@ -9152,6 +9165,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], options.contextLoader ?? this._contextLoader ?? @@ -9329,6 +9343,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], options.contextLoader ?? this._contextLoader ?? @@ -9787,6 +9802,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], options.contextLoader ?? this._contextLoader ?? @@ -9964,6 +9980,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], options.contextLoader ?? this._contextLoader ?? @@ -10414,6 +10431,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -10590,6 +10608,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -11040,6 +11059,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], options.contextLoader ?? this._contextLoader ?? @@ -11216,6 +11236,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], options.contextLoader ?? this._contextLoader ?? @@ -11665,6 +11686,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], options.contextLoader ?? this._contextLoader ?? @@ -11840,6 +11862,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], options.contextLoader ?? this._contextLoader ?? @@ -12288,6 +12311,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"replies\\", [\\"https://www.w3.org/ns/activitystreams#replies\\"], options.contextLoader ?? this._contextLoader ?? @@ -12728,6 +12752,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"shares\\", [\\"https://www.w3.org/ns/activitystreams#shares\\"], options.contextLoader ?? this._contextLoader ?? @@ -13168,6 +13193,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"likes\\", [\\"https://www.w3.org/ns/activitystreams#likes\\"], options.contextLoader ?? this._contextLoader ?? @@ -13602,6 +13628,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"emojiReactions\\", [\\"http://fedibird.com/ns#emojiReactions\\"], options.contextLoader ?? this._contextLoader ?? @@ -14097,6 +14124,7 @@ get summaries(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"tag\\", [\\"https://www.w3.org/ns/activitystreams#tag\\"], options.contextLoader ?? this._contextLoader ?? @@ -14566,6 +14594,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], options.contextLoader ?? this._contextLoader ?? @@ -14742,6 +14771,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], options.contextLoader ?? this._contextLoader ?? @@ -15177,6 +15207,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], options.contextLoader ?? this._contextLoader ?? @@ -15353,6 +15384,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], options.contextLoader ?? this._contextLoader ?? @@ -15788,6 +15820,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], options.contextLoader ?? this._contextLoader ?? @@ -15964,6 +15997,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], options.contextLoader ?? this._contextLoader ?? @@ -16399,6 +16433,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], options.contextLoader ?? this._contextLoader ?? @@ -16575,6 +16610,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], options.contextLoader ?? this._contextLoader ?? @@ -17073,6 +17109,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"proof\\", [\\"https://w3id.org/security#proof\\"], options.contextLoader ?? this._contextLoader ?? @@ -17248,6 +17285,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"proof\\", [\\"https://w3id.org/security#proof\\"], options.contextLoader ?? this._contextLoader ?? @@ -17722,6 +17760,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"likeAuthorization\\", [\\"https://gotosocial.org/ns#likeAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -18156,6 +18195,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"replyAuthorization\\", [\\"https://gotosocial.org/ns#replyAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -18590,6 +18630,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"announceAuthorization\\", [\\"https://gotosocial.org/ns#announceAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -25151,6 +25192,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], options.contextLoader ?? this._contextLoader ?? @@ -25608,6 +25650,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -28133,6 +28176,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], options.contextLoader ?? this._contextLoader ?? @@ -28310,6 +28354,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], options.contextLoader ?? this._contextLoader ?? @@ -28746,6 +28791,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], options.contextLoader ?? this._contextLoader ?? @@ -28923,6 +28969,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], options.contextLoader ?? this._contextLoader ?? @@ -29362,6 +29409,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], options.contextLoader ?? this._contextLoader ?? @@ -29542,6 +29590,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], options.contextLoader ?? this._contextLoader ?? @@ -29978,6 +30027,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], options.contextLoader ?? this._contextLoader ?? @@ -30155,6 +30205,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], options.contextLoader ?? this._contextLoader ?? @@ -30592,6 +30643,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], options.contextLoader ?? this._contextLoader ?? @@ -30770,6 +30822,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], options.contextLoader ?? this._contextLoader ?? @@ -31205,6 +31258,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], options.contextLoader ?? this._contextLoader ?? @@ -31381,6 +31435,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], options.contextLoader ?? this._contextLoader ?? @@ -35724,6 +35779,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -36157,6 +36213,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -40783,6 +40840,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -41216,6 +41274,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -43145,6 +43204,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -43578,6 +43638,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -45506,6 +45567,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -45939,6 +46001,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -48505,6 +48568,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"translator\\", [\\"https://schema.org/translator\\"], options.contextLoader ?? this._contextLoader ?? @@ -48685,6 +48749,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"translator\\", [\\"https://schema.org/translator\\"], options.contextLoader ?? this._contextLoader ?? @@ -50546,6 +50611,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -50978,6 +51044,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -53895,6 +53962,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"current\\", [\\"https://www.w3.org/ns/activitystreams#current\\"], options.contextLoader ?? this._contextLoader ?? @@ -54329,6 +54397,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"first\\", [\\"https://www.w3.org/ns/activitystreams#first\\"], options.contextLoader ?? this._contextLoader ?? @@ -54763,6 +54832,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"last\\", [\\"https://www.w3.org/ns/activitystreams#last\\"], options.contextLoader ?? this._contextLoader ?? @@ -55216,6 +55286,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"items\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], options.contextLoader ?? this._contextLoader ?? @@ -55650,6 +55721,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"likesOf\\", [\\"https://w3id.org/fep/5711#likesOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -56083,6 +56155,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"sharesOf\\", [\\"https://w3id.org/fep/5711#sharesOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -56516,6 +56589,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"repliesOf\\", [\\"https://w3id.org/fep/5711#repliesOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -56949,6 +57023,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inboxOf\\", [\\"https://w3id.org/fep/5711#inboxOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -57382,6 +57457,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outboxOf\\", [\\"https://w3id.org/fep/5711#outboxOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -57815,6 +57891,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followersOf\\", [\\"https://w3id.org/fep/5711#followersOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -58248,6 +58325,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followingOf\\", [\\"https://w3id.org/fep/5711#followingOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -58681,6 +58759,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"likedOf\\", [\\"https://w3id.org/fep/5711#likedOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -61290,6 +61369,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], options.contextLoader ?? this._contextLoader ?? @@ -63488,6 +63568,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredObject\\", [\\"https://w3id.org/fep/7aa9#featuredObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -63922,6 +64003,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featureAuthorization\\", [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -68544,6 +68626,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"owner\\", [\\"https://w3id.org/security#owner\\"], options.contextLoader ?? this._contextLoader ?? @@ -70097,6 +70180,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"controller\\", [\\"https://w3id.org/security#controller\\"], options.contextLoader ?? this._contextLoader ?? @@ -80434,6 +80518,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -80608,6 +80693,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -81045,6 +81131,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -81223,6 +81310,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -81730,6 +81818,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -82187,6 +82276,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -82624,6 +82714,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -83064,6 +83155,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -83502,6 +83594,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -83938,6 +84031,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -84374,6 +84468,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -84807,6 +84902,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -85244,6 +85340,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -85823,6 +85920,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -86319,6 +86417,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -86497,6 +86596,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -86934,6 +87034,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -87112,6 +87213,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -92326,6 +92428,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], options.contextLoader ?? this._contextLoader ?? @@ -92783,6 +92886,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -97012,6 +97116,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"partOf\\", [\\"https://www.w3.org/ns/activitystreams#partOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -97444,6 +97549,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"next\\", [\\"https://www.w3.org/ns/activitystreams#next\\"], options.contextLoader ?? this._contextLoader ?? @@ -97877,6 +97983,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"prev\\", [\\"https://www.w3.org/ns/activitystreams#prev\\"], options.contextLoader ?? this._contextLoader ?? @@ -106998,6 +107105,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -107172,6 +107280,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -107609,6 +107718,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -107787,6 +107897,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -108294,6 +108405,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -108751,6 +108863,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -109188,6 +109301,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -109628,6 +109742,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -110066,6 +110181,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -110502,6 +110618,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -110938,6 +111055,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -111371,6 +111489,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -111808,6 +111927,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -112387,6 +112507,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -112883,6 +113004,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -113061,6 +113183,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -113498,6 +113621,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -113676,6 +113800,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -118746,6 +118871,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], options.contextLoader ?? this._contextLoader ?? @@ -126207,6 +126333,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], options.contextLoader ?? this._contextLoader ?? @@ -126664,6 +126791,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -128205,6 +128333,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], options.contextLoader ?? this._contextLoader ?? @@ -132131,6 +132260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -132305,6 +132435,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -132742,6 +132873,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -132920,6 +133052,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -133427,6 +133560,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -133884,6 +134018,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -134321,6 +134456,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -134761,6 +134897,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -135199,6 +135336,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -135635,6 +135773,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -136071,6 +136210,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -136504,6 +136644,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -136941,6 +137082,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -137520,6 +137662,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -138016,6 +138159,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -138194,6 +138338,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -138631,6 +138776,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -138809,6 +138955,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -145928,6 +146075,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -146102,6 +146250,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -146539,6 +146688,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -146717,6 +146867,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -147224,6 +147375,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -147681,6 +147833,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -148118,6 +148271,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -148558,6 +148712,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -148996,6 +149151,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -149432,6 +149588,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -149868,6 +150025,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -150301,6 +150459,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -150738,6 +150897,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -151317,6 +151477,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -151813,6 +151974,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -151991,6 +152153,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -152428,6 +152591,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -152606,6 +152770,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -158116,6 +158281,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"describes\\", [\\"https://www.w3.org/ns/activitystreams#describes\\"], options.contextLoader ?? this._contextLoader ?? @@ -159892,6 +160058,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"oneOf\\", [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -160332,6 +160499,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"anyOf\\", [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -160798,6 +160966,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], options.contextLoader ?? this._contextLoader ?? @@ -161255,6 +161424,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -164373,6 +164543,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"subject\\", [\\"https://www.w3.org/ns/activitystreams#subject\\"], options.contextLoader ?? this._contextLoader ?? @@ -164806,6 +164977,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], options.contextLoader ?? this._contextLoader ?? @@ -164981,6 +165153,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], options.contextLoader ?? this._contextLoader ?? @@ -165417,6 +165590,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], options.contextLoader ?? this._contextLoader ?? @@ -165594,6 +165768,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], options.contextLoader ?? this._contextLoader ?? @@ -170167,6 +170342,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -170341,6 +170517,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -170778,6 +170955,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -170956,6 +171134,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -171463,6 +171642,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -171920,6 +172100,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -172357,6 +172538,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -172797,6 +172979,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -173235,6 +173418,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -173671,6 +173855,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -174107,6 +174292,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -174540,6 +174726,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -174977,6 +175164,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -175556,6 +175744,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -176052,6 +176241,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -176230,6 +176420,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -176667,6 +176858,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -176845,6 +177037,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 22c6fb5d9..fcc6e465c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -479,25 +479,31 @@ function expandKey( return iris; } +// Only the first entry of a context can declare that it does not propagate: +function isNonPropagatingContext(context: unknown): boolean { + const first = globalThis.Array.isArray(context) ? context[0] : context; + return first != null && typeof first === \\"object\\" && + (first as Record)[\\"@propagate\\"] === false; +} + // Whether the embedded documents under a key of a compacted document can be // decoded again in place of the values decoded for a property. The document // has to map the key, and no other key, to the property, as a context can // remap the key or map another term to the property, in which case the cached // documents cannot be matched with the decoded values. An inline context -// that does not propagate to embedded nodes, which only the first entry can -// declare, rules it out as well, since the context the embedded documents -// were decoded with cannot be rebuilt: +// that does not propagate to embedded nodes, in the document or in the +// embedded document, rules it out as well, since prepending another context +// cannot rebuild the contexts they were decoded with: async function isCachedPropertyKey( document: Record, + embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { - const context = document[\\"@context\\"]; - const first = globalThis.Array.isArray(context) ? context[0] : context; if ( - first != null && typeof first === \\"object\\" && - (first as Record)[\\"@propagate\\"] === false + isNonPropagatingContext(document[\\"@context\\"]) || + isNonPropagatingContext((embedded as { \\"@context\\"?: unknown })[\\"@context\\"]) ) { return false; } @@ -6425,6 +6431,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"attachment\\", [\\"https://www.w3.org/ns/activitystreams#attachment\\"], options.contextLoader ?? this._contextLoader ?? @@ -6921,6 +6928,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -7098,6 +7106,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -7533,6 +7542,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], options.contextLoader ?? this._contextLoader ?? @@ -7709,6 +7719,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], options.contextLoader ?? this._contextLoader ?? @@ -8197,6 +8208,7 @@ get contents(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"context\\", [\\"https://www.w3.org/ns/activitystreams#context\\"], options.contextLoader ?? this._contextLoader ?? @@ -8692,6 +8704,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"generator\\", [\\"https://www.w3.org/ns/activitystreams#generator\\"], options.contextLoader ?? this._contextLoader ?? @@ -9150,6 +9163,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], options.contextLoader ?? this._contextLoader ?? @@ -9327,6 +9341,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], options.contextLoader ?? this._contextLoader ?? @@ -9785,6 +9800,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], options.contextLoader ?? this._contextLoader ?? @@ -9962,6 +9978,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], options.contextLoader ?? this._contextLoader ?? @@ -10412,6 +10429,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -10588,6 +10606,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -11038,6 +11057,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], options.contextLoader ?? this._contextLoader ?? @@ -11214,6 +11234,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], options.contextLoader ?? this._contextLoader ?? @@ -11663,6 +11684,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], options.contextLoader ?? this._contextLoader ?? @@ -11838,6 +11860,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], options.contextLoader ?? this._contextLoader ?? @@ -12286,6 +12309,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"replies\\", [\\"https://www.w3.org/ns/activitystreams#replies\\"], options.contextLoader ?? this._contextLoader ?? @@ -12726,6 +12750,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"shares\\", [\\"https://www.w3.org/ns/activitystreams#shares\\"], options.contextLoader ?? this._contextLoader ?? @@ -13166,6 +13191,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"likes\\", [\\"https://www.w3.org/ns/activitystreams#likes\\"], options.contextLoader ?? this._contextLoader ?? @@ -13600,6 +13626,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"emojiReactions\\", [\\"http://fedibird.com/ns#emojiReactions\\"], options.contextLoader ?? this._contextLoader ?? @@ -14095,6 +14122,7 @@ get summaries(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"tag\\", [\\"https://www.w3.org/ns/activitystreams#tag\\"], options.contextLoader ?? this._contextLoader ?? @@ -14564,6 +14592,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], options.contextLoader ?? this._contextLoader ?? @@ -14740,6 +14769,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], options.contextLoader ?? this._contextLoader ?? @@ -15175,6 +15205,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], options.contextLoader ?? this._contextLoader ?? @@ -15351,6 +15382,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], options.contextLoader ?? this._contextLoader ?? @@ -15786,6 +15818,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], options.contextLoader ?? this._contextLoader ?? @@ -15962,6 +15995,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], options.contextLoader ?? this._contextLoader ?? @@ -16397,6 +16431,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], options.contextLoader ?? this._contextLoader ?? @@ -16573,6 +16608,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], options.contextLoader ?? this._contextLoader ?? @@ -17071,6 +17107,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"proof\\", [\\"https://w3id.org/security#proof\\"], options.contextLoader ?? this._contextLoader ?? @@ -17246,6 +17283,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"proof\\", [\\"https://w3id.org/security#proof\\"], options.contextLoader ?? this._contextLoader ?? @@ -17720,6 +17758,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"likeAuthorization\\", [\\"https://gotosocial.org/ns#likeAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -18154,6 +18193,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"replyAuthorization\\", [\\"https://gotosocial.org/ns#replyAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -18588,6 +18628,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"announceAuthorization\\", [\\"https://gotosocial.org/ns#announceAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -25149,6 +25190,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], options.contextLoader ?? this._contextLoader ?? @@ -25606,6 +25648,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -28131,6 +28174,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], options.contextLoader ?? this._contextLoader ?? @@ -28308,6 +28352,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], options.contextLoader ?? this._contextLoader ?? @@ -28744,6 +28789,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], options.contextLoader ?? this._contextLoader ?? @@ -28921,6 +28967,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], options.contextLoader ?? this._contextLoader ?? @@ -29360,6 +29407,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], options.contextLoader ?? this._contextLoader ?? @@ -29540,6 +29588,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], options.contextLoader ?? this._contextLoader ?? @@ -29976,6 +30025,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], options.contextLoader ?? this._contextLoader ?? @@ -30153,6 +30203,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], options.contextLoader ?? this._contextLoader ?? @@ -30590,6 +30641,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], options.contextLoader ?? this._contextLoader ?? @@ -30768,6 +30820,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], options.contextLoader ?? this._contextLoader ?? @@ -31203,6 +31256,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], options.contextLoader ?? this._contextLoader ?? @@ -31379,6 +31433,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], options.contextLoader ?? this._contextLoader ?? @@ -35722,6 +35777,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -36155,6 +36211,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -40781,6 +40838,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -41214,6 +41272,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -43143,6 +43202,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -43576,6 +43636,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -45504,6 +45565,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -45937,6 +45999,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -48503,6 +48566,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"translator\\", [\\"https://schema.org/translator\\"], options.contextLoader ?? this._contextLoader ?? @@ -48683,6 +48747,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"translator\\", [\\"https://schema.org/translator\\"], options.contextLoader ?? this._contextLoader ?? @@ -50544,6 +50609,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -50976,6 +51042,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], options.contextLoader ?? this._contextLoader ?? @@ -53893,6 +53960,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"current\\", [\\"https://www.w3.org/ns/activitystreams#current\\"], options.contextLoader ?? this._contextLoader ?? @@ -54327,6 +54395,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"first\\", [\\"https://www.w3.org/ns/activitystreams#first\\"], options.contextLoader ?? this._contextLoader ?? @@ -54761,6 +54830,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"last\\", [\\"https://www.w3.org/ns/activitystreams#last\\"], options.contextLoader ?? this._contextLoader ?? @@ -55214,6 +55284,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"items\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], options.contextLoader ?? this._contextLoader ?? @@ -55648,6 +55719,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"likesOf\\", [\\"https://w3id.org/fep/5711#likesOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -56081,6 +56153,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"sharesOf\\", [\\"https://w3id.org/fep/5711#sharesOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -56514,6 +56587,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"repliesOf\\", [\\"https://w3id.org/fep/5711#repliesOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -56947,6 +57021,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inboxOf\\", [\\"https://w3id.org/fep/5711#inboxOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -57380,6 +57455,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outboxOf\\", [\\"https://w3id.org/fep/5711#outboxOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -57813,6 +57889,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followersOf\\", [\\"https://w3id.org/fep/5711#followersOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -58246,6 +58323,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followingOf\\", [\\"https://w3id.org/fep/5711#followingOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -58679,6 +58757,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"likedOf\\", [\\"https://w3id.org/fep/5711#likedOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -61288,6 +61367,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], options.contextLoader ?? this._contextLoader ?? @@ -63486,6 +63566,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredObject\\", [\\"https://w3id.org/fep/7aa9#featuredObject\\"], options.contextLoader ?? this._contextLoader ?? @@ -63920,6 +64001,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featureAuthorization\\", [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -68542,6 +68624,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"owner\\", [\\"https://w3id.org/security#owner\\"], options.contextLoader ?? this._contextLoader ?? @@ -70095,6 +70178,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"controller\\", [\\"https://w3id.org/security#controller\\"], options.contextLoader ?? this._contextLoader ?? @@ -80432,6 +80516,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -80606,6 +80691,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -81043,6 +81129,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -81221,6 +81308,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -81728,6 +81816,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -82185,6 +82274,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -82622,6 +82712,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -83062,6 +83153,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -83500,6 +83592,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -83936,6 +84029,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -84372,6 +84466,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -84805,6 +84900,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -85242,6 +85338,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -85821,6 +85918,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -86317,6 +86415,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -86495,6 +86594,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -86932,6 +87032,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -87110,6 +87211,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -92324,6 +92426,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], options.contextLoader ?? this._contextLoader ?? @@ -92781,6 +92884,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -97010,6 +97114,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"partOf\\", [\\"https://www.w3.org/ns/activitystreams#partOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -97442,6 +97547,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"next\\", [\\"https://www.w3.org/ns/activitystreams#next\\"], options.contextLoader ?? this._contextLoader ?? @@ -97875,6 +97981,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"prev\\", [\\"https://www.w3.org/ns/activitystreams#prev\\"], options.contextLoader ?? this._contextLoader ?? @@ -106996,6 +107103,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -107170,6 +107278,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -107607,6 +107716,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -107785,6 +107895,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -108292,6 +108403,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -108749,6 +108861,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -109186,6 +109299,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -109626,6 +109740,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -110064,6 +110179,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -110500,6 +110616,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -110936,6 +111053,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -111369,6 +111487,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -111806,6 +111925,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -112385,6 +112505,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -112881,6 +113002,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -113059,6 +113181,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -113496,6 +113619,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -113674,6 +113798,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -118744,6 +118869,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], options.contextLoader ?? this._contextLoader ?? @@ -126205,6 +126331,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], options.contextLoader ?? this._contextLoader ?? @@ -126662,6 +126789,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -128203,6 +128331,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], options.contextLoader ?? this._contextLoader ?? @@ -132129,6 +132258,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -132303,6 +132433,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -132740,6 +132871,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -132918,6 +133050,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -133425,6 +133558,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -133882,6 +134016,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -134319,6 +134454,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -134759,6 +134895,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -135197,6 +135334,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -135633,6 +135771,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -136069,6 +136208,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -136502,6 +136642,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -136939,6 +137080,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -137518,6 +137660,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -138014,6 +138157,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -138192,6 +138336,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -138629,6 +138774,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -138807,6 +138953,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -145926,6 +146073,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -146100,6 +146248,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -146537,6 +146686,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -146715,6 +146865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -147222,6 +147373,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -147679,6 +147831,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -148116,6 +148269,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -148556,6 +148710,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -148994,6 +149149,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -149430,6 +149586,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -149866,6 +150023,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -150299,6 +150457,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -150736,6 +150895,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -151315,6 +151475,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -151811,6 +151972,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -151989,6 +152151,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -152426,6 +152589,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -152604,6 +152768,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -158114,6 +158279,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"describes\\", [\\"https://www.w3.org/ns/activitystreams#describes\\"], options.contextLoader ?? this._contextLoader ?? @@ -159890,6 +160056,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"oneOf\\", [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -160330,6 +160497,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"anyOf\\", [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], options.contextLoader ?? this._contextLoader ?? @@ -160796,6 +160964,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], options.contextLoader ?? this._contextLoader ?? @@ -161253,6 +161422,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], options.contextLoader ?? this._contextLoader ?? @@ -164371,6 +164541,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"subject\\", [\\"https://www.w3.org/ns/activitystreams#subject\\"], options.contextLoader ?? this._contextLoader ?? @@ -164804,6 +164975,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], options.contextLoader ?? this._contextLoader ?? @@ -164979,6 +165151,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], options.contextLoader ?? this._contextLoader ?? @@ -165415,6 +165588,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], options.contextLoader ?? this._contextLoader ?? @@ -165592,6 +165766,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], options.contextLoader ?? this._contextLoader ?? @@ -170165,6 +170340,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -170339,6 +170515,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], options.contextLoader ?? this._contextLoader ?? @@ -170776,6 +170953,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -170954,6 +171132,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], options.contextLoader ?? this._contextLoader ?? @@ -171461,6 +171640,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -171918,6 +172098,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], options.contextLoader ?? this._contextLoader ?? @@ -172355,6 +172536,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], options.contextLoader ?? this._contextLoader ?? @@ -172795,6 +172977,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], options.contextLoader ?? this._contextLoader ?? @@ -173233,6 +173416,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], options.contextLoader ?? this._contextLoader ?? @@ -173669,6 +173853,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], options.contextLoader ?? this._contextLoader ?? @@ -174105,6 +174290,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], options.contextLoader ?? this._contextLoader ?? @@ -174538,6 +174724,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], options.contextLoader ?? this._contextLoader ?? @@ -174975,6 +175162,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], options.contextLoader ?? this._contextLoader ?? @@ -175554,6 +175742,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], options.contextLoader ?? this._contextLoader ?? @@ -176050,6 +176239,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -176228,6 +176418,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], options.contextLoader ?? this._contextLoader ?? @@ -176665,6 +176856,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? @@ -176843,6 +177035,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], options.contextLoader ?? this._contextLoader ?? diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index f6a4f62f6..9b14c2e56 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -481,25 +481,31 @@ function expandKey( return iris; } +// Only the first entry of a context can declare that it does not propagate: +function isNonPropagatingContext(context: unknown): boolean { + const first = globalThis.Array.isArray(context) ? context[0] : context; + return first != null && typeof first === "object" && + (first as Record)["@propagate"] === false; +} + // Whether the embedded documents under a key of a compacted document can be // decoded again in place of the values decoded for a property. The document // has to map the key, and no other key, to the property, as a context can // remap the key or map another term to the property, in which case the cached // documents cannot be matched with the decoded values. An inline context -// that does not propagate to embedded nodes, which only the first entry can -// declare, rules it out as well, since the context the embedded documents -// were decoded with cannot be rebuilt: +// that does not propagate to embedded nodes, in the document or in the +// embedded document, rules it out as well, since prepending another context +// cannot rebuild the contexts they were decoded with: async function isCachedPropertyKey( document: Record, + embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { - const context = document["@context"]; - const first = globalThis.Array.isArray(context) ? context[0] : context; if ( - first != null && typeof first === "object" && - (first as Record)["@propagate"] === false + isNonPropagatingContext(document["@context"]) || + isNonPropagatingContext((embedded as { "@context"?: unknown })["@context"]) ) { return false; } @@ -6427,6 +6433,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "attachment", ["https://www.w3.org/ns/activitystreams#attachment"], options.contextLoader ?? this._contextLoader ?? @@ -6923,6 +6930,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "attributedTo", ["https://www.w3.org/ns/activitystreams#attributedTo"], options.contextLoader ?? this._contextLoader ?? @@ -7100,6 +7108,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "attributedTo", ["https://www.w3.org/ns/activitystreams#attributedTo"], options.contextLoader ?? this._contextLoader ?? @@ -7535,6 +7544,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "audience", ["https://www.w3.org/ns/activitystreams#audience"], options.contextLoader ?? this._contextLoader ?? @@ -7711,6 +7721,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "audience", ["https://www.w3.org/ns/activitystreams#audience"], options.contextLoader ?? this._contextLoader ?? @@ -8199,6 +8210,7 @@ get contents(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "context", ["https://www.w3.org/ns/activitystreams#context"], options.contextLoader ?? this._contextLoader ?? @@ -8694,6 +8706,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "generator", ["https://www.w3.org/ns/activitystreams#generator"], options.contextLoader ?? this._contextLoader ?? @@ -9152,6 +9165,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "icon", ["https://www.w3.org/ns/activitystreams#icon"], options.contextLoader ?? this._contextLoader ?? @@ -9329,6 +9343,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "icon", ["https://www.w3.org/ns/activitystreams#icon"], options.contextLoader ?? this._contextLoader ?? @@ -9787,6 +9802,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "image", ["https://www.w3.org/ns/activitystreams#image"], options.contextLoader ?? this._contextLoader ?? @@ -9964,6 +9980,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "image", ["https://www.w3.org/ns/activitystreams#image"], options.contextLoader ?? this._contextLoader ?? @@ -10414,6 +10431,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "inReplyTo", ["https://www.w3.org/ns/activitystreams#inReplyTo"], options.contextLoader ?? this._contextLoader ?? @@ -10590,6 +10608,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "inReplyTo", ["https://www.w3.org/ns/activitystreams#inReplyTo"], options.contextLoader ?? this._contextLoader ?? @@ -11040,6 +11059,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "location", ["https://www.w3.org/ns/activitystreams#location"], options.contextLoader ?? this._contextLoader ?? @@ -11216,6 +11236,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "location", ["https://www.w3.org/ns/activitystreams#location"], options.contextLoader ?? this._contextLoader ?? @@ -11665,6 +11686,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "preview", ["https://www.w3.org/ns/activitystreams#preview"], options.contextLoader ?? this._contextLoader ?? @@ -11840,6 +11862,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "preview", ["https://www.w3.org/ns/activitystreams#preview"], options.contextLoader ?? this._contextLoader ?? @@ -12288,6 +12311,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "replies", ["https://www.w3.org/ns/activitystreams#replies"], options.contextLoader ?? this._contextLoader ?? @@ -12728,6 +12752,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "shares", ["https://www.w3.org/ns/activitystreams#shares"], options.contextLoader ?? this._contextLoader ?? @@ -13168,6 +13193,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "likes", ["https://www.w3.org/ns/activitystreams#likes"], options.contextLoader ?? this._contextLoader ?? @@ -13602,6 +13628,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "emojiReactions", ["http://fedibird.com/ns#emojiReactions"], options.contextLoader ?? this._contextLoader ?? @@ -14097,6 +14124,7 @@ get summaries(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "tag", ["https://www.w3.org/ns/activitystreams#tag"], options.contextLoader ?? this._contextLoader ?? @@ -14566,6 +14594,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "to", ["https://www.w3.org/ns/activitystreams#to"], options.contextLoader ?? this._contextLoader ?? @@ -14742,6 +14771,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "to", ["https://www.w3.org/ns/activitystreams#to"], options.contextLoader ?? this._contextLoader ?? @@ -15177,6 +15207,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "bto", ["https://www.w3.org/ns/activitystreams#bto"], options.contextLoader ?? this._contextLoader ?? @@ -15353,6 +15384,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "bto", ["https://www.w3.org/ns/activitystreams#bto"], options.contextLoader ?? this._contextLoader ?? @@ -15788,6 +15820,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "cc", ["https://www.w3.org/ns/activitystreams#cc"], options.contextLoader ?? this._contextLoader ?? @@ -15964,6 +15997,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "cc", ["https://www.w3.org/ns/activitystreams#cc"], options.contextLoader ?? this._contextLoader ?? @@ -16399,6 +16433,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "bcc", ["https://www.w3.org/ns/activitystreams#bcc"], options.contextLoader ?? this._contextLoader ?? @@ -16575,6 +16610,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "bcc", ["https://www.w3.org/ns/activitystreams#bcc"], options.contextLoader ?? this._contextLoader ?? @@ -17073,6 +17109,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "proof", ["https://w3id.org/security#proof"], options.contextLoader ?? this._contextLoader ?? @@ -17248,6 +17285,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "proof", ["https://w3id.org/security#proof"], options.contextLoader ?? this._contextLoader ?? @@ -17722,6 +17760,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "likeAuthorization", ["https://gotosocial.org/ns#likeAuthorization"], options.contextLoader ?? this._contextLoader ?? @@ -18156,6 +18195,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "replyAuthorization", ["https://gotosocial.org/ns#replyAuthorization"], options.contextLoader ?? this._contextLoader ?? @@ -18590,6 +18630,7 @@ get urls(): ((URL | Link))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "announceAuthorization", ["https://gotosocial.org/ns#announceAuthorization"], options.contextLoader ?? this._contextLoader ?? @@ -25151,6 +25192,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "quote", ["https://w3id.org/fep/044f#quote"], options.contextLoader ?? this._contextLoader ?? @@ -25608,6 +25650,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], options.contextLoader ?? this._contextLoader ?? @@ -28133,6 +28176,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "actor", ["https://www.w3.org/ns/activitystreams#actor"], options.contextLoader ?? this._contextLoader ?? @@ -28310,6 +28354,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "actor", ["https://www.w3.org/ns/activitystreams#actor"], options.contextLoader ?? this._contextLoader ?? @@ -28746,6 +28791,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "object", ["https://www.w3.org/ns/activitystreams#object"], options.contextLoader ?? this._contextLoader ?? @@ -28923,6 +28969,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "object", ["https://www.w3.org/ns/activitystreams#object"], options.contextLoader ?? this._contextLoader ?? @@ -29362,6 +29409,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "target", ["https://www.w3.org/ns/activitystreams#target"], options.contextLoader ?? this._contextLoader ?? @@ -29542,6 +29590,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "target", ["https://www.w3.org/ns/activitystreams#target"], options.contextLoader ?? this._contextLoader ?? @@ -29978,6 +30027,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "result", ["https://www.w3.org/ns/activitystreams#result"], options.contextLoader ?? this._contextLoader ?? @@ -30155,6 +30205,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "result", ["https://www.w3.org/ns/activitystreams#result"], options.contextLoader ?? this._contextLoader ?? @@ -30592,6 +30643,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "origin", ["https://www.w3.org/ns/activitystreams#origin"], options.contextLoader ?? this._contextLoader ?? @@ -30770,6 +30822,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "origin", ["https://www.w3.org/ns/activitystreams#origin"], options.contextLoader ?? this._contextLoader ?? @@ -31205,6 +31258,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "instrument", ["https://www.w3.org/ns/activitystreams#instrument"], options.contextLoader ?? this._contextLoader ?? @@ -31381,6 +31435,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "instrument", ["https://www.w3.org/ns/activitystreams#instrument"], options.contextLoader ?? this._contextLoader ?? @@ -35724,6 +35779,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], options.contextLoader ?? this._contextLoader ?? @@ -36157,6 +36213,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], options.contextLoader ?? this._contextLoader ?? @@ -40783,6 +40840,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], options.contextLoader ?? this._contextLoader ?? @@ -41216,6 +41274,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], options.contextLoader ?? this._contextLoader ?? @@ -43145,6 +43204,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], options.contextLoader ?? this._contextLoader ?? @@ -43578,6 +43638,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], options.contextLoader ?? this._contextLoader ?? @@ -45506,6 +45567,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], options.contextLoader ?? this._contextLoader ?? @@ -45939,6 +46001,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], options.contextLoader ?? this._contextLoader ?? @@ -48505,6 +48568,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "translator", ["https://schema.org/translator"], options.contextLoader ?? this._contextLoader ?? @@ -48685,6 +48749,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "translator", ["https://schema.org/translator"], options.contextLoader ?? this._contextLoader ?? @@ -50546,6 +50611,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], options.contextLoader ?? this._contextLoader ?? @@ -50978,6 +51044,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], options.contextLoader ?? this._contextLoader ?? @@ -53895,6 +53962,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "current", ["https://www.w3.org/ns/activitystreams#current"], options.contextLoader ?? this._contextLoader ?? @@ -54329,6 +54397,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "first", ["https://www.w3.org/ns/activitystreams#first"], options.contextLoader ?? this._contextLoader ?? @@ -54763,6 +54832,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "last", ["https://www.w3.org/ns/activitystreams#last"], options.contextLoader ?? this._contextLoader ?? @@ -55216,6 +55286,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "items", ["https://www.w3.org/ns/activitystreams#items"], options.contextLoader ?? this._contextLoader ?? @@ -55650,6 +55721,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "likesOf", ["https://w3id.org/fep/5711#likesOf"], options.contextLoader ?? this._contextLoader ?? @@ -56083,6 +56155,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "sharesOf", ["https://w3id.org/fep/5711#sharesOf"], options.contextLoader ?? this._contextLoader ?? @@ -56516,6 +56589,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "repliesOf", ["https://w3id.org/fep/5711#repliesOf"], options.contextLoader ?? this._contextLoader ?? @@ -56949,6 +57023,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "inboxOf", ["https://w3id.org/fep/5711#inboxOf"], options.contextLoader ?? this._contextLoader ?? @@ -57382,6 +57457,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "outboxOf", ["https://w3id.org/fep/5711#outboxOf"], options.contextLoader ?? this._contextLoader ?? @@ -57815,6 +57891,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "followersOf", ["https://w3id.org/fep/5711#followersOf"], options.contextLoader ?? this._contextLoader ?? @@ -58248,6 +58325,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "followingOf", ["https://w3id.org/fep/5711#followingOf"], options.contextLoader ?? this._contextLoader ?? @@ -58681,6 +58759,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "likedOf", ["https://w3id.org/fep/5711#likedOf"], options.contextLoader ?? this._contextLoader ?? @@ -61290,6 +61369,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "orderedItems", ["https://www.w3.org/ns/activitystreams#items"], options.contextLoader ?? this._contextLoader ?? @@ -63488,6 +63568,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredObject", ["https://w3id.org/fep/7aa9#featuredObject"], options.contextLoader ?? this._contextLoader ?? @@ -63922,6 +64003,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featureAuthorization", ["https://w3id.org/fep/7aa9#featureAuthorization"], options.contextLoader ?? this._contextLoader ?? @@ -68544,6 +68626,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "owner", ["https://w3id.org/security#owner"], options.contextLoader ?? this._contextLoader ?? @@ -70097,6 +70180,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "controller", ["https://w3id.org/security#controller"], options.contextLoader ?? this._contextLoader ?? @@ -80434,6 +80518,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -80608,6 +80693,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -81045,6 +81131,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -81223,6 +81310,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -81730,6 +81818,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], options.contextLoader ?? this._contextLoader ?? @@ -82187,6 +82276,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], options.contextLoader ?? this._contextLoader ?? @@ -82624,6 +82714,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "following", ["https://www.w3.org/ns/activitystreams#following"], options.contextLoader ?? this._contextLoader ?? @@ -83064,6 +83155,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], options.contextLoader ?? this._contextLoader ?? @@ -83502,6 +83594,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], options.contextLoader ?? this._contextLoader ?? @@ -83938,6 +84031,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featured", ["http://joinmastodon.org/ns#featured"], options.contextLoader ?? this._contextLoader ?? @@ -84374,6 +84468,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], options.contextLoader ?? this._contextLoader ?? @@ -84807,6 +84902,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], options.contextLoader ?? this._contextLoader ?? @@ -85244,6 +85340,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], options.contextLoader ?? this._contextLoader ?? @@ -85823,6 +85920,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], options.contextLoader ?? this._contextLoader ?? @@ -86319,6 +86417,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -86497,6 +86596,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -86934,6 +87034,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? @@ -87112,6 +87213,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? @@ -92326,6 +92428,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "quote", ["https://w3id.org/fep/044f#quote"], options.contextLoader ?? this._contextLoader ?? @@ -92783,6 +92886,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], options.contextLoader ?? this._contextLoader ?? @@ -97012,6 +97116,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "partOf", ["https://www.w3.org/ns/activitystreams#partOf"], options.contextLoader ?? this._contextLoader ?? @@ -97444,6 +97549,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "next", ["https://www.w3.org/ns/activitystreams#next"], options.contextLoader ?? this._contextLoader ?? @@ -97877,6 +97983,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "prev", ["https://www.w3.org/ns/activitystreams#prev"], options.contextLoader ?? this._contextLoader ?? @@ -106998,6 +107105,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -107172,6 +107280,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -107609,6 +107718,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -107787,6 +107897,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -108294,6 +108405,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], options.contextLoader ?? this._contextLoader ?? @@ -108751,6 +108863,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], options.contextLoader ?? this._contextLoader ?? @@ -109188,6 +109301,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "following", ["https://www.w3.org/ns/activitystreams#following"], options.contextLoader ?? this._contextLoader ?? @@ -109628,6 +109742,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], options.contextLoader ?? this._contextLoader ?? @@ -110066,6 +110181,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], options.contextLoader ?? this._contextLoader ?? @@ -110502,6 +110618,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featured", ["http://joinmastodon.org/ns#featured"], options.contextLoader ?? this._contextLoader ?? @@ -110938,6 +111055,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], options.contextLoader ?? this._contextLoader ?? @@ -111371,6 +111489,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], options.contextLoader ?? this._contextLoader ?? @@ -111808,6 +111927,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], options.contextLoader ?? this._contextLoader ?? @@ -112387,6 +112507,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], options.contextLoader ?? this._contextLoader ?? @@ -112883,6 +113004,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -113061,6 +113183,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -113498,6 +113621,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? @@ -113676,6 +113800,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? @@ -118746,6 +118871,7 @@ get names(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "preview", ["https://www.w3.org/ns/activitystreams#preview"], options.contextLoader ?? this._contextLoader ?? @@ -126207,6 +126333,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "quote", ["https://w3id.org/fep/044f#quote"], options.contextLoader ?? this._contextLoader ?? @@ -126664,6 +126791,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], options.contextLoader ?? this._contextLoader ?? @@ -128205,6 +128333,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "orderedItems", ["https://www.w3.org/ns/activitystreams#items"], options.contextLoader ?? this._contextLoader ?? @@ -132131,6 +132260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -132305,6 +132435,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -132742,6 +132873,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -132920,6 +133052,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -133427,6 +133560,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], options.contextLoader ?? this._contextLoader ?? @@ -133884,6 +134018,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], options.contextLoader ?? this._contextLoader ?? @@ -134321,6 +134456,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "following", ["https://www.w3.org/ns/activitystreams#following"], options.contextLoader ?? this._contextLoader ?? @@ -134761,6 +134897,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], options.contextLoader ?? this._contextLoader ?? @@ -135199,6 +135336,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], options.contextLoader ?? this._contextLoader ?? @@ -135635,6 +135773,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featured", ["http://joinmastodon.org/ns#featured"], options.contextLoader ?? this._contextLoader ?? @@ -136071,6 +136210,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], options.contextLoader ?? this._contextLoader ?? @@ -136504,6 +136644,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], options.contextLoader ?? this._contextLoader ?? @@ -136941,6 +137082,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], options.contextLoader ?? this._contextLoader ?? @@ -137520,6 +137662,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], options.contextLoader ?? this._contextLoader ?? @@ -138016,6 +138159,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -138194,6 +138338,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -138631,6 +138776,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? @@ -138809,6 +138955,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? @@ -145928,6 +146075,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -146102,6 +146250,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -146539,6 +146688,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -146717,6 +146867,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -147224,6 +147375,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], options.contextLoader ?? this._contextLoader ?? @@ -147681,6 +147833,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], options.contextLoader ?? this._contextLoader ?? @@ -148118,6 +148271,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "following", ["https://www.w3.org/ns/activitystreams#following"], options.contextLoader ?? this._contextLoader ?? @@ -148558,6 +148712,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], options.contextLoader ?? this._contextLoader ?? @@ -148996,6 +149151,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], options.contextLoader ?? this._contextLoader ?? @@ -149432,6 +149588,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featured", ["http://joinmastodon.org/ns#featured"], options.contextLoader ?? this._contextLoader ?? @@ -149868,6 +150025,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], options.contextLoader ?? this._contextLoader ?? @@ -150301,6 +150459,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], options.contextLoader ?? this._contextLoader ?? @@ -150738,6 +150897,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], options.contextLoader ?? this._contextLoader ?? @@ -151317,6 +151477,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], options.contextLoader ?? this._contextLoader ?? @@ -151813,6 +151974,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -151991,6 +152153,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -152428,6 +152591,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? @@ -152606,6 +152770,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? @@ -158116,6 +158281,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "describes", ["https://www.w3.org/ns/activitystreams#describes"], options.contextLoader ?? this._contextLoader ?? @@ -159892,6 +160058,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "oneOf", ["https://www.w3.org/ns/activitystreams#oneOf"], options.contextLoader ?? this._contextLoader ?? @@ -160332,6 +160499,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "anyOf", ["https://www.w3.org/ns/activitystreams#anyOf"], options.contextLoader ?? this._contextLoader ?? @@ -160798,6 +160966,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "quote", ["https://w3id.org/fep/044f#quote"], options.contextLoader ?? this._contextLoader ?? @@ -161255,6 +161424,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], options.contextLoader ?? this._contextLoader ?? @@ -164373,6 +164543,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "subject", ["https://www.w3.org/ns/activitystreams#subject"], options.contextLoader ?? this._contextLoader ?? @@ -164806,6 +164977,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "object", ["https://www.w3.org/ns/activitystreams#object"], options.contextLoader ?? this._contextLoader ?? @@ -164981,6 +165153,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "object", ["https://www.w3.org/ns/activitystreams#object"], options.contextLoader ?? this._contextLoader ?? @@ -165417,6 +165590,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "relationship", ["https://www.w3.org/ns/activitystreams#relationship"], options.contextLoader ?? this._contextLoader ?? @@ -165594,6 +165768,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "relationship", ["https://www.w3.org/ns/activitystreams#relationship"], options.contextLoader ?? this._contextLoader ?? @@ -170167,6 +170342,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -170341,6 +170517,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "publicKey", ["https://w3id.org/security#publicKey"], options.contextLoader ?? this._contextLoader ?? @@ -170778,6 +170955,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -170956,6 +171134,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], options.contextLoader ?? this._contextLoader ?? @@ -171463,6 +171642,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], options.contextLoader ?? this._contextLoader ?? @@ -171920,6 +172100,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], options.contextLoader ?? this._contextLoader ?? @@ -172357,6 +172538,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "following", ["https://www.w3.org/ns/activitystreams#following"], options.contextLoader ?? this._contextLoader ?? @@ -172797,6 +172979,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], options.contextLoader ?? this._contextLoader ?? @@ -173235,6 +173418,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], options.contextLoader ?? this._contextLoader ?? @@ -173671,6 +173855,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featured", ["http://joinmastodon.org/ns#featured"], options.contextLoader ?? this._contextLoader ?? @@ -174107,6 +174292,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], options.contextLoader ?? this._contextLoader ?? @@ -174540,6 +174726,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], options.contextLoader ?? this._contextLoader ?? @@ -174977,6 +175164,7 @@ get gateways(): (URL)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], options.contextLoader ?? this._contextLoader ?? @@ -175556,6 +175744,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], options.contextLoader ?? this._contextLoader ?? @@ -176052,6 +176241,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -176230,6 +176420,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], options.contextLoader ?? this._contextLoader ?? @@ -176667,6 +176858,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? @@ -176845,6 +177037,7 @@ get attributionDomains(): (string)[] { if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, "service", ["https://www.w3.org/ns/did#service"], options.contextLoader ?? this._contextLoader ?? diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index cf4fdd78b..872c52c02 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -494,6 +494,7 @@ async function* generateProperty( if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + doc, ${JSON.stringify(property.compactName)}, ${ JSON.stringify([ @@ -693,6 +694,7 @@ async function* generateProperty( if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + obj, ${JSON.stringify(property.compactName)}, ${ JSON.stringify([ diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index b5a53c65a..e9c99af16 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -158,25 +158,31 @@ function expandKey( return iris; } +// Only the first entry of a context can declare that it does not propagate: +function isNonPropagatingContext(context: unknown): boolean { + const first = globalThis.Array.isArray(context) ? context[0] : context; + return first != null && typeof first === "object" && + (first as Record)["@propagate"] === false; +} + // Whether the embedded documents under a key of a compacted document can be // decoded again in place of the values decoded for a property. The document // has to map the key, and no other key, to the property, as a context can // remap the key or map another term to the property, in which case the cached // documents cannot be matched with the decoded values. An inline context -// that does not propagate to embedded nodes, which only the first entry can -// declare, rules it out as well, since the context the embedded documents -// were decoded with cannot be rebuilt: +// that does not propagate to embedded nodes, in the document or in the +// embedded document, rules it out as well, since prepending another context +// cannot rebuild the contexts they were decoded with: async function isCachedPropertyKey( document: Record, + embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { - const context = document["@context"]; - const first = globalThis.Array.isArray(context) ? context[0] : context; if ( - first != null && typeof first === "object" && - (first as Record)["@propagate"] === false + isNonPropagatingContext(document["@context"]) || + isNonPropagatingContext((embedded as { "@context"?: unknown })["@context"]) ) { return false; } diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index 6fd210a9a..f6cc52553 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -268,6 +268,32 @@ test("embedded objects do not inherit non-propagating contexts", async () => { deepStrictEqual(note.contents, ["Hello"]); }); +test("embedded objects keep their own non-propagating contexts", async () => { + const create = await Create.fromJsonLd({ + "@context": AS, + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": [{ "@propagate": false, body: `${AS}#content` }, AS], + id: "https://example.com/notes/1", + type: "Note", + attachment: { + "@context": AS, + type: "Document", + // The term is out of scope here, so this is not the content: + body: "Not the content", + content: "Hello", + }, + }, + }); + const note = await create.getObject(); + ok(note instanceof Note); + const [attachment] = await Array.fromAsync(note.getAttachments()); + ok(attachment instanceof ASObject); + deepStrictEqual(attachment.contents, ["Hello"]); +}); + test("getRawPropertyValues() reads embedded objects under terms of the parent's context", async () => { const note = await Note.fromJsonLd({ "@context": [AS, { extra: `${AS}#attachment`, attachment: null }], From 9338289bc2c16c63f2a72840eea3496703b1a6b3 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 6 Nov 2026 16:04:40 +0900 Subject: [PATCH 26/35] Track merged exports when resolving IRI lint helpers TypeScript makes what one declaration of a namespace or enum exports visible in the other declarations of the same name. A call in a reopened namespace could therefore refer to an exported function, yet the raw-property-iri-invalid rule resolved it to the imported helper and reported its argument. The rule now collects the exported values and enum members of merged declarations in the same scope, and treats them as shadowing outer bindings. Non-exported members and other namespaces do not count, so helper calls there are still checked. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4488661185 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 68 +++++++++++++++++-- .../tests/raw-property-iri-invalid.test.ts | 22 ++++++ 2 files changed, 84 insertions(+), 6 deletions(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index f0fcca13e..0cfdbd244 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -24,8 +24,11 @@ interface Binding { interface Scope { parent?: Scope; functionScope: boolean; - /** Whether declarations merged from elsewhere can add to this scope. */ - mergeable?: boolean; + /** + * The names that declarations merged with this namespace or enum export. + * It is set on the scopes of those, and only of those. + */ + merged?: Set; bindings: Map; } @@ -226,9 +229,37 @@ function lookup( ): Binding | undefined { for (; scope; scope = scope.parent) { if (scope.bindings.has(identifier)) return scope.bindings.get(identifier); + if (scope.merged?.has(identifier)) return {}; } } +/** Lists the values that the body of a TypeScript namespace exports. */ +function exportedNames(block: Ast): string[] { + const scope: Scope = { functionScope: true, bindings: new Map() }; + for (const statement of (block.body ?? []) as Ast[]) { + const declaration = statement.type === "ExportNamedDeclaration" + ? ast(statement.declaration) + : statement.type === "TSImportEqualsDeclaration" && + statement.isExport === true + ? statement + : undefined; + if (declaration?.type === "VariableDeclaration") { + for (const variable of declaration.declarations as Ast[]) { + bind(variable.id, scope); + } + } else if ( + declaration != null && + declaration.type !== "TSInterfaceDeclaration" && + declaration.type !== "TSTypeAliasDeclaration" && + (declaration.type !== "TSModuleDeclaration" || + isInstantiated(declaration)) + ) { + bind(declaration.id, scope); + } + } + return [...scope.bindings.keys()]; +} + /** * Looks up a binding to follow for its value. Another declaration of the same * namespace or enum can export a member that shadows an outer binding, so @@ -240,7 +271,7 @@ function lookupConstant( ): Binding | undefined { for (; scope; scope = scope.parent) { if (scope.bindings.has(identifier)) return scope.bindings.get(identifier); - if (scope.mergeable) return undefined; + if (scope.merged != null) return undefined; } } @@ -256,7 +287,27 @@ export function checkRawPropertyIris( const scopes = new WeakMap(); const calls: Ast[] = []; const root: Scope = { functionScope: true, bindings: new Map() }; + // TypeScript merges namespaces and enums of the same name in a scope, and + // makes what each declaration exports visible in the others: + const members = new Map>>(); + const blockMembers = new WeakMap>(); + function mergedMembers(scope: Scope, id: string | undefined): Set { + if (id == null) return new Set(); + let names = members.get(scope); + if (names == null) members.set(scope, names = new Map()); + let merged = names.get(id); + if (merged == null) names.set(id, merged = new Set()); + return merged; + } function visit(node: Ast, outer: Scope): void { + if (node.type === "TSModuleDeclaration") { + const body = ast(node.body); + if (body?.type === "TSModuleBlock") { + const merged = mergedMembers(outer, name(node.id)); + blockMembers.set(body, merged); + for (const exported of exportedNames(body)) merged.add(exported); + } + } const isFunction = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/ .test(node.type); @@ -288,8 +339,11 @@ export function checkRawPropertyIris( // A TypeScript namespace body is compiled to a function body: functionScope: isFunction || node.type === "StaticBlock" || node.type === "TSModuleBlock", - mergeable: node.type === "TSModuleBlock" || - node.type === "TSEnumDeclaration", + merged: node.type === "TSModuleBlock" + ? blockMembers.get(node) ?? new Set() + : node.type === "TSEnumDeclaration" + ? mergedMembers(outer, name(node.id)) + : undefined, bindings: new Map(), } : outer; @@ -311,7 +365,9 @@ export function checkRawPropertyIris( const members = (node.members ?? body?.members ?? []) as Ast[]; for (const member of members) { const id = name(member.id); - if (id != null) scope.bindings.set(id, {}); + if (id == null) continue; + scope.bindings.set(id, {}); + scope.merged?.add(id); } } if (node.type === "ImportDeclaration") { diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index f44d7057a..17c32c88e 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -230,6 +230,28 @@ cases.push( "merged enum members hide outer bindings", `${setup} const iri = "content"; enum E { iri = "https://example/p" } enum E { V = (read(obj, iri), 0) }`, ], + [ + "merged namespace exports shadow helpers", + `${setup} namespace N { export function read(o: unknown, i: string) {} } namespace N { read({}, "content"); }`, + ], + [ + "merged namespace exported variables shadow helpers", + `${setup} namespace N { export const read = (o: unknown, i: string) => {}; } namespace N { read({}, "content"); }`, + ], + [ + "merged namespace locals do not shadow helpers", + `${setup} namespace N { function read(o: unknown, i: string) {} } namespace N { read({}, "content"); }`, + "must be a full", + ], + [ + "unrelated namespace exports do not shadow helpers", + `${setup} namespace M { export function read(o: unknown, i: string) {} } namespace N { read({}, "content"); }`, + "must be a full", + ], + [ + "merged enum members shadow helpers", + `${setup} enum E { read = 1 } enum E { V = (read({}, "content"), 0) }`, + ], [ "enum members shadow outer bindings", `${setup} const iri = "content"; enum E { iri = "https://example/p", V = (read(obj, iri), 0) }`, From 3865313675074b61cefc01927fb8ba560151d9c5 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 6 Nov 2026 17:05:02 +0900 Subject: [PATCH 27/35] Reject invalid ports in raw property IRIs The authority check only looked at square brackets, so an IRI with a malformed port, such as https://example.com:abc/p, was looked up and yielded an empty result instead of the documented TypeError. An authority without an IP literal may now have at most one colon after its userinfo, followed only by digits. The raw-property-iri-invalid lint rule applies the same check. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4490000685 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 7 ++++--- .../lint/src/tests/raw-property-iri-invalid.test.ts | 3 +++ .../vocab-runtime/src/internal/raw-property.test.ts | 11 +++++++++++ packages/vocab-runtime/src/internal/raw-property.ts | 7 ++++--- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 0cfdbd244..99f84e601 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -179,14 +179,15 @@ const IP_LITERAL_PATTERN = /^\[([^\[\]]*)\](?::[0-9]*)?$/; const IP_FUTURE_PATTERN = /^v[0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+$/i; /** - * Checks that square brackets in an authority delimit an IPv6 address or an - * IPvFuture literal as the whole host, as the runtime does. + * Checks that an authority has a numeric port, if any, and that square + * brackets delimit an IPv6 address or an IPvFuture literal as the whole host, + * as the runtime does. */ function isAuthoritySyntax(authority: string): boolean { const hostPort = authority.slice(authority.lastIndexOf("@") + 1); const userinfo = authority.slice(0, authority.length - hostPort.length); if (/[[\]]/.test(userinfo)) return false; - if (!/[[\]]/.test(hostPort)) return true; + if (!/[[\]]/.test(hostPort)) return /^[^:]*(?::[0-9]*)?$/.test(hostPort); const match = IP_LITERAL_PATTERN.exec(hostPort); if (match == null) return false; const literal = match[1]; diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index 17c32c88e..161ac7993 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -15,6 +15,8 @@ const cases: [string, string, string?][] = [ "https://example/path[0]", "https://[abc]/x", "https://a[::1]/x", + "https://example:abc/p", + "https://example:80:90/p", "https://example/\ud800", "@id", "_:node", @@ -261,6 +263,7 @@ cases.push( `${setup} enum E { V = (read(obj, "content"), 0) }`, "must be a full", ], + ["numeric port", `${setup} read(obj, "https://u:p@example:8080/p");`], ["IPv6 authority", `${setup} read(obj, "https://[::1]/property");`], [ "IPvFuture authority", diff --git a/packages/vocab-runtime/src/internal/raw-property.test.ts b/packages/vocab-runtime/src/internal/raw-property.test.ts index 51fe01dab..cee02dbcf 100644 --- a/packages/vocab-runtime/src/internal/raw-property.test.ts +++ b/packages/vocab-runtime/src/internal/raw-property.test.ts @@ -37,6 +37,14 @@ test("parseRawPropertyIri() accepts absolute IRIs", () => { deepStrictEqual(parseRawPropertyIri("urn://[v1.fe80::a+en1]/p", "f"), [ "urn://[v1.fe80::a+en1]/p", ]); + deepStrictEqual( + parseRawPropertyIri("https://user:pass@example.com:8080/p", "f"), + ["https://user:pass@example.com:8080/p"], + ); + deepStrictEqual( + parseRawPropertyIri("https://example.com:/p", "f")[0], + "https://example.com:/p", + ); deepStrictEqual(parseRawPropertyIri("urn:example:prop", "f"), [ "urn:example:prop", ]); @@ -69,6 +77,9 @@ test("parseRawPropertyIri() rejects what is not an absolute IRI", () => { "https://a[::1]/x", "https://[u@]::1]/x", "https://[v1]/x", + "https://example.com:abc/p", + "https://example.com:80:90/p", + "https://user@example.com:8a/p", "https://example.com/\uD800", ] ) { diff --git a/packages/vocab-runtime/src/internal/raw-property.ts b/packages/vocab-runtime/src/internal/raw-property.ts index 1d96d6a08..53e231b99 100644 --- a/packages/vocab-runtime/src/internal/raw-property.ts +++ b/packages/vocab-runtime/src/internal/raw-property.ts @@ -357,14 +357,15 @@ const IP_LITERAL_PATTERN = /^\[([^\[\]]*)\](?::[0-9]*)?$/; const IP_FUTURE_PATTERN = /^v[0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+$/i; /** - * Checks that square brackets in an authority delimit an IPv6 address or an - * IPvFuture literal as the whole host, as RFC 3986 requires. + * Checks that an authority has a numeric port, if any, and that square + * brackets delimit an IPv6 address or an IPvFuture literal as the whole host, + * as RFC 3986 requires. */ function isAuthoritySyntax(authority: string): boolean { const hostPort = authority.slice(authority.lastIndexOf("@") + 1); const userinfo = authority.slice(0, authority.length - hostPort.length); if (/[[\]]/.test(userinfo)) return false; - if (!/[[\]]/.test(hostPort)) return true; + if (!/[[\]]/.test(hostPort)) return /^[^:]*(?::[0-9]*)?$/.test(hostPort); const match = IP_LITERAL_PATTERN.exec(hostPort); if (match == null) return false; const literal = match[1]; From 03d5993d44c827e5379aa4c1d35036b87f05b8ba Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 6 Nov 2026 18:31:21 +0900 Subject: [PATCH 28/35] Accept both @emnapi lines in Astro compat tests The Astro compatibility harness pinned @napi-rs/wasm-runtime to 1.1.6, which accepts only @emnapi/* 1.x peers, because its consumers provided those. Rolldown 1.3.0, which Astro 7 installs now, provides @emnapi/* 2.0.0-beta.2 instead, so pnpm install --strict-peer-dependencies failed for the Astro 7 cases. Version 1.2.7 accepts both lines, so it can serve every Astro version under test. Changelog: none Assisted-by: Claude Code:claude-opus-5-5 --- packages/astro/compat/run.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/astro/compat/run.ts b/packages/astro/compat/run.ts index b25389a09..b60f19026 100644 --- a/packages/astro/compat/run.ts +++ b/packages/astro/compat/run.ts @@ -101,9 +101,10 @@ async function testCompatibility(testCase: CompatibilityCase): Promise { pnpm: { overrides: { ...Object.fromEntries(tarballs), - // Version 1.2.0 requires @emnapi/* 2.0 prereleases, while its - // consumers still provide @emnapi/* 1.x. - "@napi-rs/wasm-runtime@^1.1.6": "1.1.6", + // Consumers provide either @emnapi/* 1.x or 2.0 prereleases, and + // versions in between accept only one of them, while this one + // accepts both. + "@napi-rs/wasm-runtime@^1.1.6": "1.2.7", }, }, }, From 16a5c34d315213a701e2f907adf8f482829e5443 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 6 Nov 2026 18:52:49 +0900 Subject: [PATCH 29/35] Keep inherited contexts out of cached JSON-LD Decoding a cached embedded object with the parent's context also put the merged context into that object's own cache. A proof on the embedded object covers its received context, so a signed object taken out with an accessor could no longer be verified from its toJsonLd() result. The cache now keeps the document as received, and the context the object was decoded with is held separately, for decoding the objects nested in it. As a result, the toJsonLd() output of embedded objects does not change at all. Prepending the parent's context also cannot reproduce a property-scoped context, so an override in one, such as { body: null }, was lost. When the parent's term for the property has a scoped context, the accessor now keeps the object decoded with the whole document. The tests for reparse failures relied on such a context, so they now give the decoded object a malformed cache directly. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4490488598 https://github.com/fedify-dev/fedify/pull/1356#discussion_r4490488606 Assisted-by: Claude Code:claude-opus-5-5 --- CHANGES.md | 3 - changes.d/vocab/embedded-object-context.md | 3 - .../src/__snapshots__/class.test.ts.deno.snap | 3621 ++++++++++++++--- .../src/__snapshots__/class.test.ts.node.snap | 3621 ++++++++++++++--- .../src/__snapshots__/class.test.ts.snap | 3621 ++++++++++++++--- packages/vocab-tools/src/property.ts | 38 +- packages/vocab-tools/src/raw-property.ts | 68 +- packages/vocab/src/raw-property.test.ts | 83 + packages/vocab/src/vocab.test.ts | 45 +- 9 files changed, 9359 insertions(+), 1744 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 250cea8ee..e5f2c4c8f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -367,9 +367,6 @@ To be released. the enclosing context mapped to another property. The accessors now apply the enclosing context and fall back to the object decoded with the whole document when the cached JSON-LD cannot be matched with it. - The `toJsonLd()` result of such an embedded object now also includes the - enclosing context in front of its own, unless its own context already - begins with it, so it means the same when used on its own. [[#1272], [#1356]] [FEP-6757]: https://w3id.org/fep/6757 diff --git a/changes.d/vocab/embedded-object-context.md b/changes.d/vocab/embedded-object-context.md index 20a3de108..87641e811 100644 --- a/changes.d/vocab/embedded-object-context.md +++ b/changes.d/vocab/embedded-object-context.md @@ -12,7 +12,4 @@ links: the enclosing context mapped to another property. The accessors now apply the enclosing context and fall back to the object decoded with the whole document when the cached JSON-LD cannot be matched with it. - The `toJsonLd()` result of such an embedded object now also includes the - enclosing context in front of its own, unless its own context already - begins with it, so it means the same when used on its own. [[#1272], [#1356]] diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 1bb65a9e2..24325a0c6 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -420,14 +420,51 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } +// The contexts embedded objects were decoded with, keyed by the objects. Their +// cached JSON-LD stays as it was received, as a proof can cover its context, so +// this is what decoding the objects nested in them has to start from: +const inheritedContexts = new WeakMap(); + +function getCachedJsonLdContext(object: object, context: unknown): unknown { + return inheritedContexts.has(object) + ? inheritedContexts.get(object) + : context; +} + +// Puts the document an embedded object was received as back into its cache, +// after decoding it from the result of inheritJsonLdContext(): +async function keepCachedJsonLd( + object: object, + document: object, + decoded: object, + contextLoader: DocumentLoader, +): Promise { + if (decoded === document) return; + const target = object as unknown as { _cachedJsonLd?: unknown }; + const cached = target._cachedJsonLd; + if (cached == null) return; + inheritedContexts.set(object, (decoded as { \\"@context\\"?: unknown })[\\"@context\\"]); + // The decoder can normalize what it caches, e.g., portable object IRIs: + target._cachedJsonLd = + globalThis.JSON.stringify(cached) === globalThis.JSON.stringify(decoded) + ? structuredClone(document) + : await compactJsonLdCache( + await jsonld.expand(cached, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }), + document, + contextLoader, + ); +} + // Embeds the context of a cached document in a document embedded in it, so // that decoding the embedded document alone resolves its terms the same way // as decoding the whole document did. The parent's context entries keep // their order, as later entries can refer to terms earlier ones define. // When the embedded document's own context already begins with all of them, // it is used as is, since applying the same entries again yields the same -// terms. Property-scoped contexts of the parent are not applied, as the -// embedded document is decoded as a top-level node: +// terms: function inheritJsonLdContext( parentContext: unknown, document: object, @@ -455,6 +492,7 @@ const expandedKeys = new WeakMap>>(); function expandKey( document: Record, + context: unknown, key: string, contextLoader: DocumentLoader, ): Promise { @@ -466,7 +504,7 @@ function expandKey( const cached = keys.get(key); if (cached != null) return cached; const iris = jsonld.expand( - { \\"@context\\": document[\\"@context\\"], [key]: [] }, + { \\"@context\\": context, [key]: [] }, { documentLoader: contextLoader, keepFreeFloatingNodes: true }, ).then((expanded: unknown[]) => globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => @@ -488,35 +526,47 @@ function isNonPropagatingContext(context: unknown): boolean { (first as Record)[\\"@propagate\\"] === false; } +function hasPropertyScopedContext(context: unknown, key: string): boolean { + const entries = globalThis.Array.isArray(context) ? context : [context]; + return entries.some((entry) => { + const term = entry != null && typeof entry === \\"object\\" + ? (entry as Record)[key] + : undefined; + return term != null && typeof term === \\"object\\" && \\"@context\\" in term; + }); +} + // Whether the embedded documents under a key of a compacted document can be // decoded again in place of the values decoded for a property. The document // has to map the key, and no other key, to the property, as a context can // remap the key or map another term to the property, in which case the cached // documents cannot be matched with the decoded values. An inline context // that does not propagate to embedded nodes, in the document or in the -// embedded document, rules it out as well, since prepending another context -// cannot rebuild the contexts they were decoded with: +// embedded document, and a property-scoped context for the key rule it out as +// well, since prepending a context cannot rebuild what they were decoded with: async function isCachedPropertyKey( document: Record, + context: unknown, embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { if ( - isNonPropagatingContext(document[\\"@context\\"]) || - isNonPropagatingContext((embedded as { \\"@context\\"?: unknown })[\\"@context\\"]) + isNonPropagatingContext(context) || + isNonPropagatingContext((embedded as { \\"@context\\"?: unknown })[\\"@context\\"]) || + hasPropertyScopedContext(context, key) ) { return false; } - const own = await expandKey(document, key, contextLoader); + const own = await expandKey(document, context, key, contextLoader); if (own.length !== 1 || own[0] !== iris[0]) return false; const others = await globalThis.Promise.all( globalThis.Object.keys(document) .filter((k) => k !== key && !k.startsWith(\\"@\\")) // Keyword aliases, such as id, cannot take an empty array, and are // not properties anyway: - .map((k) => expandKey(document, k, contextLoader).catch(() => [])), + .map((k) => expandKey(document, context, k, contextLoader).catch(() => [])), ); return !others.flat().some((iri) => iris.includes(iri)); } @@ -6430,18 +6480,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"attachment\\", [\\"https://www.w3.org/ns/activitystreams#attachment\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#attachment_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -6455,6 +6512,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -6927,18 +6990,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#attribution_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -6952,6 +7022,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -7105,18 +7181,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#attribution_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -7130,6 +7213,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -7541,18 +7630,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#audience_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -7566,6 +7662,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -7718,18 +7820,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#audience_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -7743,6 +7852,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -8207,18 +8322,25 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"context\\", [\\"https://www.w3.org/ns/activitystreams#context\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#context_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -8232,6 +8354,12 @@ get contents(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -8703,18 +8831,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"generator\\", [\\"https://www.w3.org/ns/activitystreams#generator\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#generator_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -8728,6 +8863,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9162,18 +9303,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#icon_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -9187,6 +9335,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9340,18 +9494,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#icon_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -9365,6 +9526,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9799,18 +9966,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#image_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -9824,6 +9998,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9977,18 +10157,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#image_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -10002,6 +10189,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -10428,18 +10621,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#replyTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -10453,6 +10653,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -10605,18 +10811,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#replyTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -10630,6 +10843,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11056,18 +11275,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#location_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11081,6 +11307,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11233,18 +11465,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#location_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11258,6 +11497,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11683,18 +11928,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#preview_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11708,6 +11960,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11859,18 +12117,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#preview_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11884,6 +12149,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -12308,18 +12579,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"replies\\", [\\"https://www.w3.org/ns/activitystreams#replies\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#replies_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -12333,6 +12611,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -12749,18 +13033,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"shares\\", [\\"https://www.w3.org/ns/activitystreams#shares\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#shares_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -12774,6 +13065,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -13190,18 +13487,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"likes\\", [\\"https://www.w3.org/ns/activitystreams#likes\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likes_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -13215,6 +13519,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -13625,18 +13935,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"emojiReactions\\", [\\"http://fedibird.com/ns#emojiReactions\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#emojiReactions_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -13650,6 +13967,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -14121,18 +14444,25 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"tag\\", [\\"https://www.w3.org/ns/activitystreams#tag\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#tag_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -14146,6 +14476,12 @@ get summaries(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -14591,18 +14927,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#to_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -14616,6 +14959,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -14768,18 +15117,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#to_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -14793,6 +15149,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15204,18 +15566,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#bto_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -15229,6 +15598,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15381,18 +15756,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#bto_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -15406,6 +15788,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15817,18 +16205,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#cc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -15842,6 +16237,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15994,18 +16395,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#cc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -16019,6 +16427,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -16430,18 +16844,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#bcc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -16455,6 +16876,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -16607,18 +17034,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#bcc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -16632,6 +17066,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -17106,18 +17546,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"proof\\", [\\"https://w3id.org/security#proof\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#proof_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -17131,6 +17578,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -17282,18 +17735,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"proof\\", [\\"https://w3id.org/security#proof\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#proof_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -17307,6 +17767,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -17757,18 +18223,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"likeAuthorization\\", [\\"https://gotosocial.org/ns#likeAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likeAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -17782,6 +18255,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -18192,18 +18671,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"replyAuthorization\\", [\\"https://gotosocial.org/ns#replyAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#replyAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -18217,6 +18703,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -18627,18 +19119,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"announceAuthorization\\", [\\"https://gotosocial.org/ns#announceAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#announceAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -18652,6 +19151,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -25189,18 +25694,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -25214,6 +25726,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -25647,18 +26165,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -25672,6 +26197,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28173,18 +28704,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#actor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28198,6 +28736,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28351,18 +28895,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#actor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28376,6 +28927,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28788,18 +29345,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28813,6 +29377,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28966,18 +29536,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28991,6 +29568,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -29406,18 +29989,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#target_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -29431,6 +30021,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -29587,18 +30183,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#target_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -29612,6 +30215,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30024,18 +30633,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#result_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30049,6 +30665,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30202,18 +30824,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#result_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30227,6 +30856,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30640,18 +31275,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#origin_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30665,6 +31307,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30819,18 +31467,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#origin_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30844,6 +31499,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -31255,18 +31916,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#instrument_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -31280,6 +31948,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -31432,18 +32106,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#instrument_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -31457,6 +32138,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -35776,18 +36463,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -35801,6 +36495,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -36210,18 +36910,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -36235,6 +36942,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -40837,18 +41550,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -40862,6 +41582,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -41271,18 +41997,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -41296,6 +42029,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -43201,18 +43940,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -43226,6 +43972,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -43635,18 +44387,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -43660,6 +44419,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -45564,18 +46329,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -45589,6 +46361,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -45998,18 +46776,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -46023,6 +46808,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -48565,18 +49356,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"translator\\", [\\"https://schema.org/translator\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#translator_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -48590,6 +49388,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -48746,18 +49550,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"translator\\", [\\"https://schema.org/translator\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#translator_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -48771,6 +49582,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -50608,18 +51425,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -50633,6 +51457,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -51041,18 +51871,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -51066,6 +51903,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -53959,18 +54802,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"current\\", [\\"https://www.w3.org/ns/activitystreams#current\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#current_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -53984,6 +54834,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -54394,18 +55250,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"first\\", [\\"https://www.w3.org/ns/activitystreams#first\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#first_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -54419,6 +55282,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -54829,18 +55698,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"last\\", [\\"https://www.w3.org/ns/activitystreams#last\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#last_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -54854,6 +55730,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -55283,18 +56165,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"items\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#item_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -55308,6 +56197,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -55718,18 +56613,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"likesOf\\", [\\"https://w3id.org/fep/5711#likesOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likesOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -55743,6 +56645,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -56152,18 +57060,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"sharesOf\\", [\\"https://w3id.org/fep/5711#sharesOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#sharesOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -56177,6 +57092,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -56586,18 +57507,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"repliesOf\\", [\\"https://w3id.org/fep/5711#repliesOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#repliesOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -56611,6 +57539,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -57020,18 +57954,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inboxOf\\", [\\"https://w3id.org/fep/5711#inboxOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inboxOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -57045,6 +57986,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -57454,18 +58401,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outboxOf\\", [\\"https://w3id.org/fep/5711#outboxOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outboxOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -57479,6 +58433,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -57888,18 +58848,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followersOf\\", [\\"https://w3id.org/fep/5711#followersOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followersOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -57913,6 +58880,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -58322,18 +59295,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followingOf\\", [\\"https://w3id.org/fep/5711#followingOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followingOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -58347,6 +59327,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -58756,18 +59742,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"likedOf\\", [\\"https://w3id.org/fep/5711#likedOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likedOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -58781,6 +59774,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -61366,18 +62365,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#item_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -61391,6 +62397,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -63565,18 +64577,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredObject\\", [\\"https://w3id.org/fep/7aa9#featuredObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -63590,6 +64609,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -64000,18 +65025,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featureAuthorization\\", [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featureAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -64025,6 +65057,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -68623,18 +69661,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"owner\\", [\\"https://w3id.org/security#owner\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#owner_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -68648,6 +69693,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -70177,18 +71228,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"controller\\", [\\"https://w3id.org/security#controller\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#controller_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -70202,6 +71260,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -80515,18 +81579,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -80540,6 +81611,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -80690,18 +81767,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -80715,6 +81799,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -81128,18 +82218,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -81153,6 +82250,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -81307,18 +82410,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -81332,6 +82442,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -81815,18 +82931,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -81840,6 +82963,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -82273,18 +83402,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -82298,6 +83434,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -82711,18 +83853,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -82736,6 +83885,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -83152,18 +84307,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -83177,6 +84339,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -83591,18 +84759,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -83616,6 +84791,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -84028,18 +85209,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -84053,6 +85241,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -84465,18 +85659,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -84490,6 +85691,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -84899,18 +86106,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -84924,6 +86138,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -85337,18 +86557,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -85362,6 +86589,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -85917,18 +87150,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -85942,6 +87182,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -86414,18 +87660,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -86439,6 +87692,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -86593,18 +87852,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -86618,6 +87884,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -87031,18 +88303,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -87056,6 +88335,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -87210,18 +88495,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -87235,6 +88527,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -92425,18 +93723,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -92450,6 +93755,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -92883,18 +94194,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -92908,6 +94226,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -97113,18 +98437,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"partOf\\", [\\"https://www.w3.org/ns/activitystreams#partOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#partOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -97138,6 +98469,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -97546,18 +98883,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"next\\", [\\"https://www.w3.org/ns/activitystreams#next\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#next_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -97571,6 +98915,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -97980,18 +99330,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"prev\\", [\\"https://www.w3.org/ns/activitystreams#prev\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#prev_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -98005,6 +99362,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107102,18 +108465,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107127,6 +108497,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107277,18 +108653,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107302,6 +108685,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107715,18 +109104,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107740,6 +109136,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107894,18 +109296,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107919,6 +109328,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -108402,18 +109817,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -108427,6 +109849,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -108860,18 +110288,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -108885,6 +110320,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -109298,18 +110739,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -109323,6 +110771,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -109739,18 +111193,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -109764,6 +111225,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -110178,18 +111645,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -110203,6 +111677,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -110615,18 +112095,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -110640,6 +112127,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -111052,18 +112545,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -111077,6 +112577,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -111486,18 +112992,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -111511,6 +113024,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -111924,18 +113443,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -111949,6 +113475,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -112504,18 +114036,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -112529,6 +114068,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113001,18 +114546,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113026,6 +114578,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113180,18 +114738,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113205,6 +114770,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113618,18 +115189,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113643,6 +115221,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113797,18 +115381,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113822,6 +115413,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -118868,18 +120465,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#preview_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -118893,6 +120497,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -126330,18 +127940,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -126355,6 +127972,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -126788,18 +128411,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -126813,6 +128443,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -128330,18 +129966,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#item_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -128355,6 +129998,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -132257,18 +133906,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -132282,6 +133938,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -132432,18 +134094,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -132457,6 +134126,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -132870,18 +134545,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -132895,6 +134577,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -133049,18 +134737,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -133074,6 +134769,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -133557,18 +135258,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -133582,6 +135290,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -134015,18 +135729,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -134040,6 +135761,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -134453,18 +136180,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -134478,6 +136212,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -134894,18 +136634,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -134919,6 +136666,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -135333,18 +137086,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -135358,6 +137118,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -135770,18 +137536,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -135795,6 +137568,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -136207,18 +137986,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -136232,6 +138018,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -136641,18 +138433,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -136666,6 +138465,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -137079,18 +138884,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -137104,6 +138916,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -137659,18 +139477,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -137684,6 +139509,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138156,18 +139987,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138181,6 +140019,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138335,18 +140179,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138360,6 +140211,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138773,18 +140630,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138798,6 +140662,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138952,18 +140822,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138977,6 +140854,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146072,18 +147955,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146097,6 +147987,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146247,18 +148143,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146272,6 +148175,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146685,18 +148594,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146710,6 +148626,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146864,18 +148786,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146889,6 +148818,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -147372,18 +149307,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -147397,6 +149339,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -147830,18 +149778,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -147855,6 +149810,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -148268,18 +150229,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -148293,6 +150261,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -148709,18 +150683,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -148734,6 +150715,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -149148,18 +151135,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -149173,6 +151167,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -149585,18 +151585,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -149610,6 +151617,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -150022,18 +152035,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -150047,6 +152067,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -150456,18 +152482,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -150481,6 +152514,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -150894,18 +152933,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -150919,6 +152965,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -151474,18 +153526,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -151499,6 +153558,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -151971,18 +154036,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -151996,6 +154068,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -152150,18 +154228,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -152175,6 +154260,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -152588,18 +154679,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -152613,6 +154711,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -152767,18 +154871,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -152792,6 +154903,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -158278,18 +160395,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"describes\\", [\\"https://www.w3.org/ns/activitystreams#describes\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#describes_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -158303,6 +160427,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -160055,18 +162185,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"oneOf\\", [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#exclusiveOption_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -160080,6 +162217,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -160496,18 +162639,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"anyOf\\", [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#inclusiveOption_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -160521,6 +162671,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -160963,18 +163119,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -160988,6 +163151,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -161421,18 +163590,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -161446,6 +163622,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -164540,18 +166722,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"subject\\", [\\"https://www.w3.org/ns/activitystreams#subject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#subject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -164565,6 +166754,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -164974,18 +167169,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -164999,6 +167201,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -165150,18 +167358,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -165175,6 +167390,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -165587,18 +167808,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#relationship_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -165612,6 +167840,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -165765,18 +167999,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#relationship_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -165790,6 +168031,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -170339,18 +172586,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -170364,6 +172618,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -170514,18 +172774,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -170539,6 +172806,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -170952,18 +173225,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -170977,6 +173257,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -171131,18 +173417,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -171156,6 +173449,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -171639,18 +173938,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -171664,6 +173970,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -172097,18 +174409,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -172122,6 +174441,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -172535,18 +174860,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -172560,6 +174892,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -172976,18 +175314,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -173001,6 +175346,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -173415,18 +175766,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -173440,6 +175798,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -173852,18 +176216,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -173877,6 +176248,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -174289,18 +176666,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -174314,6 +176698,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -174723,18 +177113,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -174748,6 +177145,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -175161,18 +177564,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -175186,6 +177596,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -175741,18 +178157,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -175766,6 +178189,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -176238,18 +178667,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -176263,6 +178699,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -176417,18 +178859,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -176442,6 +178891,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -176855,18 +179310,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -176880,6 +179342,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -177034,18 +179502,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -177059,6 +179534,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index fcc6e465c..f0b9d1f6a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -418,14 +418,51 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } +// The contexts embedded objects were decoded with, keyed by the objects. Their +// cached JSON-LD stays as it was received, as a proof can cover its context, so +// this is what decoding the objects nested in them has to start from: +const inheritedContexts = new WeakMap(); + +function getCachedJsonLdContext(object: object, context: unknown): unknown { + return inheritedContexts.has(object) + ? inheritedContexts.get(object) + : context; +} + +// Puts the document an embedded object was received as back into its cache, +// after decoding it from the result of inheritJsonLdContext(): +async function keepCachedJsonLd( + object: object, + document: object, + decoded: object, + contextLoader: DocumentLoader, +): Promise { + if (decoded === document) return; + const target = object as unknown as { _cachedJsonLd?: unknown }; + const cached = target._cachedJsonLd; + if (cached == null) return; + inheritedContexts.set(object, (decoded as { \\"@context\\"?: unknown })[\\"@context\\"]); + // The decoder can normalize what it caches, e.g., portable object IRIs: + target._cachedJsonLd = + globalThis.JSON.stringify(cached) === globalThis.JSON.stringify(decoded) + ? structuredClone(document) + : await compactJsonLdCache( + await jsonld.expand(cached, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }), + document, + contextLoader, + ); +} + // Embeds the context of a cached document in a document embedded in it, so // that decoding the embedded document alone resolves its terms the same way // as decoding the whole document did. The parent's context entries keep // their order, as later entries can refer to terms earlier ones define. // When the embedded document's own context already begins with all of them, // it is used as is, since applying the same entries again yields the same -// terms. Property-scoped contexts of the parent are not applied, as the -// embedded document is decoded as a top-level node: +// terms: function inheritJsonLdContext( parentContext: unknown, document: object, @@ -453,6 +490,7 @@ const expandedKeys = new WeakMap>>(); function expandKey( document: Record, + context: unknown, key: string, contextLoader: DocumentLoader, ): Promise { @@ -464,7 +502,7 @@ function expandKey( const cached = keys.get(key); if (cached != null) return cached; const iris = jsonld.expand( - { \\"@context\\": document[\\"@context\\"], [key]: [] }, + { \\"@context\\": context, [key]: [] }, { documentLoader: contextLoader, keepFreeFloatingNodes: true }, ).then((expanded: unknown[]) => globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => @@ -486,35 +524,47 @@ function isNonPropagatingContext(context: unknown): boolean { (first as Record)[\\"@propagate\\"] === false; } +function hasPropertyScopedContext(context: unknown, key: string): boolean { + const entries = globalThis.Array.isArray(context) ? context : [context]; + return entries.some((entry) => { + const term = entry != null && typeof entry === \\"object\\" + ? (entry as Record)[key] + : undefined; + return term != null && typeof term === \\"object\\" && \\"@context\\" in term; + }); +} + // Whether the embedded documents under a key of a compacted document can be // decoded again in place of the values decoded for a property. The document // has to map the key, and no other key, to the property, as a context can // remap the key or map another term to the property, in which case the cached // documents cannot be matched with the decoded values. An inline context // that does not propagate to embedded nodes, in the document or in the -// embedded document, rules it out as well, since prepending another context -// cannot rebuild the contexts they were decoded with: +// embedded document, and a property-scoped context for the key rule it out as +// well, since prepending a context cannot rebuild what they were decoded with: async function isCachedPropertyKey( document: Record, + context: unknown, embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { if ( - isNonPropagatingContext(document[\\"@context\\"]) || - isNonPropagatingContext((embedded as { \\"@context\\"?: unknown })[\\"@context\\"]) + isNonPropagatingContext(context) || + isNonPropagatingContext((embedded as { \\"@context\\"?: unknown })[\\"@context\\"]) || + hasPropertyScopedContext(context, key) ) { return false; } - const own = await expandKey(document, key, contextLoader); + const own = await expandKey(document, context, key, contextLoader); if (own.length !== 1 || own[0] !== iris[0]) return false; const others = await globalThis.Promise.all( globalThis.Object.keys(document) .filter((k) => k !== key && !k.startsWith(\\"@\\")) // Keyword aliases, such as id, cannot take an empty array, and are // not properties anyway: - .map((k) => expandKey(document, k, contextLoader).catch(() => [])), + .map((k) => expandKey(document, context, k, contextLoader).catch(() => [])), ); return !others.flat().some((iri) => iris.includes(iri)); } @@ -6428,18 +6478,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"attachment\\", [\\"https://www.w3.org/ns/activitystreams#attachment\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#attachment_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -6453,6 +6510,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -6925,18 +6988,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#attribution_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -6950,6 +7020,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -7103,18 +7179,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#attribution_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -7128,6 +7211,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -7539,18 +7628,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#audience_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -7564,6 +7660,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -7716,18 +7818,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#audience_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -7741,6 +7850,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -8205,18 +8320,25 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"context\\", [\\"https://www.w3.org/ns/activitystreams#context\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#context_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -8230,6 +8352,12 @@ get contents(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -8701,18 +8829,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"generator\\", [\\"https://www.w3.org/ns/activitystreams#generator\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#generator_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -8726,6 +8861,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9160,18 +9301,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#icon_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -9185,6 +9333,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9338,18 +9492,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#icon_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -9363,6 +9524,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9797,18 +9964,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#image_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -9822,6 +9996,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9975,18 +10155,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#image_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -10000,6 +10187,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -10426,18 +10619,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#replyTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -10451,6 +10651,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -10603,18 +10809,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#replyTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -10628,6 +10841,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11054,18 +11273,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#location_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11079,6 +11305,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11231,18 +11463,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#location_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11256,6 +11495,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11681,18 +11926,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#preview_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11706,6 +11958,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11857,18 +12115,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#preview_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11882,6 +12147,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -12306,18 +12577,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"replies\\", [\\"https://www.w3.org/ns/activitystreams#replies\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#replies_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -12331,6 +12609,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -12747,18 +13031,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"shares\\", [\\"https://www.w3.org/ns/activitystreams#shares\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#shares_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -12772,6 +13063,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -13188,18 +13485,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"likes\\", [\\"https://www.w3.org/ns/activitystreams#likes\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likes_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -13213,6 +13517,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -13623,18 +13933,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"emojiReactions\\", [\\"http://fedibird.com/ns#emojiReactions\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#emojiReactions_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -13648,6 +13965,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -14119,18 +14442,25 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"tag\\", [\\"https://www.w3.org/ns/activitystreams#tag\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#tag_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -14144,6 +14474,12 @@ get summaries(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -14589,18 +14925,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#to_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -14614,6 +14957,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -14766,18 +15115,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#to_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -14791,6 +15147,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15202,18 +15564,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#bto_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -15227,6 +15596,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15379,18 +15754,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#bto_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -15404,6 +15786,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15815,18 +16203,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#cc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -15840,6 +16235,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15992,18 +16393,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#cc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -16017,6 +16425,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -16428,18 +16842,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#bcc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -16453,6 +16874,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -16605,18 +17032,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#bcc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -16630,6 +17064,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -17104,18 +17544,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"proof\\", [\\"https://w3id.org/security#proof\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#proof_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -17129,6 +17576,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -17280,18 +17733,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"proof\\", [\\"https://w3id.org/security#proof\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#proof_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -17305,6 +17765,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -17755,18 +18221,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"likeAuthorization\\", [\\"https://gotosocial.org/ns#likeAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likeAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -17780,6 +18253,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -18190,18 +18669,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"replyAuthorization\\", [\\"https://gotosocial.org/ns#replyAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#replyAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -18215,6 +18701,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -18625,18 +19117,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"announceAuthorization\\", [\\"https://gotosocial.org/ns#announceAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#announceAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -18650,6 +19149,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -25187,18 +25692,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -25212,6 +25724,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -25645,18 +26163,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -25670,6 +26195,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28171,18 +28702,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#actor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28196,6 +28734,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28349,18 +28893,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#actor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28374,6 +28925,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28786,18 +29343,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28811,6 +29375,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28964,18 +29534,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28989,6 +29566,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -29404,18 +29987,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#target_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -29429,6 +30019,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -29585,18 +30181,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#target_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -29610,6 +30213,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30022,18 +30631,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#result_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30047,6 +30663,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30200,18 +30822,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#result_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30225,6 +30854,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30638,18 +31273,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#origin_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30663,6 +31305,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30817,18 +31465,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#origin_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30842,6 +31497,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -31253,18 +31914,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#instrument_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -31278,6 +31946,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -31430,18 +32104,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#instrument_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -31455,6 +32136,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -35774,18 +36461,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -35799,6 +36493,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -36208,18 +36908,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -36233,6 +36940,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -40835,18 +41548,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -40860,6 +41580,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -41269,18 +41995,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -41294,6 +42027,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -43199,18 +43938,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -43224,6 +43970,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -43633,18 +44385,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -43658,6 +44417,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -45562,18 +46327,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -45587,6 +46359,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -45996,18 +46774,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -46021,6 +46806,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -48563,18 +49354,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"translator\\", [\\"https://schema.org/translator\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#translator_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -48588,6 +49386,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -48744,18 +49548,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"translator\\", [\\"https://schema.org/translator\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#translator_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -48769,6 +49580,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -50606,18 +51423,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -50631,6 +51455,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -51039,18 +51869,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -51064,6 +51901,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -53957,18 +54800,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"current\\", [\\"https://www.w3.org/ns/activitystreams#current\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#current_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -53982,6 +54832,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -54392,18 +55248,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"first\\", [\\"https://www.w3.org/ns/activitystreams#first\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#first_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -54417,6 +55280,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -54827,18 +55696,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"last\\", [\\"https://www.w3.org/ns/activitystreams#last\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#last_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -54852,6 +55728,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -55281,18 +56163,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"items\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#item_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -55306,6 +56195,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -55716,18 +56611,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"likesOf\\", [\\"https://w3id.org/fep/5711#likesOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likesOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -55741,6 +56643,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -56150,18 +57058,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"sharesOf\\", [\\"https://w3id.org/fep/5711#sharesOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#sharesOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -56175,6 +57090,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -56584,18 +57505,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"repliesOf\\", [\\"https://w3id.org/fep/5711#repliesOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#repliesOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -56609,6 +57537,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -57018,18 +57952,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inboxOf\\", [\\"https://w3id.org/fep/5711#inboxOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inboxOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -57043,6 +57984,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -57452,18 +58399,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outboxOf\\", [\\"https://w3id.org/fep/5711#outboxOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outboxOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -57477,6 +58431,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -57886,18 +58846,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followersOf\\", [\\"https://w3id.org/fep/5711#followersOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followersOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -57911,6 +58878,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -58320,18 +59293,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followingOf\\", [\\"https://w3id.org/fep/5711#followingOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followingOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -58345,6 +59325,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -58754,18 +59740,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"likedOf\\", [\\"https://w3id.org/fep/5711#likedOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likedOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -58779,6 +59772,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -61364,18 +62363,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#item_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -61389,6 +62395,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -63563,18 +64575,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredObject\\", [\\"https://w3id.org/fep/7aa9#featuredObject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -63588,6 +64607,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -63998,18 +65023,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featureAuthorization\\", [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featureAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -64023,6 +65055,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -68621,18 +69659,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"owner\\", [\\"https://w3id.org/security#owner\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#owner_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -68646,6 +69691,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -70175,18 +71226,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"controller\\", [\\"https://w3id.org/security#controller\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#controller_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -70200,6 +71258,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -80513,18 +81577,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -80538,6 +81609,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -80688,18 +81765,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -80713,6 +81797,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -81126,18 +82216,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -81151,6 +82248,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -81305,18 +82408,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -81330,6 +82440,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -81813,18 +82929,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -81838,6 +82961,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -82271,18 +83400,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -82296,6 +83432,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -82709,18 +83851,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -82734,6 +83883,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -83150,18 +84305,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -83175,6 +84337,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -83589,18 +84757,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -83614,6 +84789,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -84026,18 +85207,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -84051,6 +85239,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -84463,18 +85657,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -84488,6 +85689,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -84897,18 +86104,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -84922,6 +86136,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -85335,18 +86555,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -85360,6 +86587,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -85915,18 +87148,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -85940,6 +87180,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -86412,18 +87658,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -86437,6 +87690,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -86591,18 +87850,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -86616,6 +87882,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -87029,18 +88301,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -87054,6 +88333,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -87208,18 +88493,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -87233,6 +88525,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -92423,18 +93721,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -92448,6 +93753,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -92881,18 +94192,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -92906,6 +94224,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -97111,18 +98435,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"partOf\\", [\\"https://www.w3.org/ns/activitystreams#partOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#partOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -97136,6 +98467,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -97544,18 +98881,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"next\\", [\\"https://www.w3.org/ns/activitystreams#next\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#next_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -97569,6 +98913,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -97978,18 +99328,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"prev\\", [\\"https://www.w3.org/ns/activitystreams#prev\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#prev_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -98003,6 +99360,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107100,18 +108463,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107125,6 +108495,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107275,18 +108651,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107300,6 +108683,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107713,18 +109102,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107738,6 +109134,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107892,18 +109294,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107917,6 +109326,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -108400,18 +109815,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -108425,6 +109847,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -108858,18 +110286,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -108883,6 +110318,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -109296,18 +110737,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -109321,6 +110769,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -109737,18 +111191,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -109762,6 +111223,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -110176,18 +111643,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -110201,6 +111675,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -110613,18 +112093,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -110638,6 +112125,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -111050,18 +112543,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -111075,6 +112575,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -111484,18 +112990,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -111509,6 +113022,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -111922,18 +113441,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -111947,6 +113473,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -112502,18 +114034,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -112527,6 +114066,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -112999,18 +114544,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113024,6 +114576,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113178,18 +114736,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113203,6 +114768,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113616,18 +115187,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113641,6 +115219,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113795,18 +115379,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113820,6 +115411,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -118866,18 +120463,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#preview_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -118891,6 +120495,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -126328,18 +127938,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -126353,6 +127970,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -126786,18 +128409,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -126811,6 +128441,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -128328,18 +129964,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#item_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -128353,6 +129996,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -132255,18 +133904,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -132280,6 +133936,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -132430,18 +134092,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -132455,6 +134124,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -132868,18 +134543,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -132893,6 +134575,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -133047,18 +134735,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -133072,6 +134767,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -133555,18 +135256,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -133580,6 +135288,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -134013,18 +135727,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -134038,6 +135759,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -134451,18 +136178,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -134476,6 +136210,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -134892,18 +136632,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -134917,6 +136664,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -135331,18 +137084,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -135356,6 +137116,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -135768,18 +137534,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -135793,6 +137566,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -136205,18 +137984,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -136230,6 +138016,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -136639,18 +138431,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -136664,6 +138463,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -137077,18 +138882,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -137102,6 +138914,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -137657,18 +139475,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -137682,6 +139507,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138154,18 +139985,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138179,6 +140017,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138333,18 +140177,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138358,6 +140209,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138771,18 +140628,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138796,6 +140660,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138950,18 +140820,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138975,6 +140852,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146070,18 +147953,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146095,6 +147985,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146245,18 +148141,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146270,6 +148173,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146683,18 +148592,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146708,6 +148624,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146862,18 +148784,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146887,6 +148816,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -147370,18 +149305,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -147395,6 +149337,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -147828,18 +149776,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -147853,6 +149808,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -148266,18 +150227,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -148291,6 +150259,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -148707,18 +150681,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -148732,6 +150713,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -149146,18 +151133,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -149171,6 +151165,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -149583,18 +151583,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -149608,6 +151615,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -150020,18 +152033,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -150045,6 +152065,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -150454,18 +152480,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -150479,6 +152512,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -150892,18 +152931,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -150917,6 +152963,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -151472,18 +153524,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -151497,6 +153556,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -151969,18 +154034,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -151994,6 +154066,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -152148,18 +154226,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -152173,6 +154258,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -152586,18 +154677,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -152611,6 +154709,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -152765,18 +154869,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -152790,6 +154901,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -158276,18 +160393,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"describes\\", [\\"https://www.w3.org/ns/activitystreams#describes\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#describes_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -158301,6 +160425,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -160053,18 +162183,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"oneOf\\", [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#exclusiveOption_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -160078,6 +162215,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -160494,18 +162637,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"anyOf\\", [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#inclusiveOption_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -160519,6 +162669,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -160961,18 +163117,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -160986,6 +163149,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -161419,18 +163588,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -161444,6 +163620,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -164538,18 +166720,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"subject\\", [\\"https://www.w3.org/ns/activitystreams#subject\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#subject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -164563,6 +166752,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -164972,18 +167167,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -164997,6 +167199,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -165148,18 +167356,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -165173,6 +167388,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -165585,18 +167806,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#relationship_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -165610,6 +167838,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -165763,18 +167997,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#relationship_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -165788,6 +168029,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -170337,18 +172584,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -170362,6 +172616,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -170512,18 +172772,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -170537,6 +172804,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -170950,18 +173223,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -170975,6 +173255,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -171129,18 +173415,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -171154,6 +173447,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -171637,18 +173936,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -171662,6 +173968,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -172095,18 +174407,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -172120,6 +174439,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -172533,18 +174858,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -172558,6 +174890,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -172974,18 +175312,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -172999,6 +175344,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -173413,18 +175764,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -173438,6 +175796,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -173850,18 +176214,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -173875,6 +176246,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -174287,18 +176664,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -174312,6 +176696,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -174721,18 +177111,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -174746,6 +177143,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -175159,18 +177562,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -175184,6 +177594,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -175739,18 +178155,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -175764,6 +178187,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -176236,18 +178665,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -176261,6 +178697,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -176415,18 +178857,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -176440,6 +178889,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -176853,18 +179308,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -176878,6 +179340,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -177032,18 +179500,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd[\\"@context\\"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -177057,6 +179532,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 9b14c2e56..2dcb4d518 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -420,14 +420,51 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } +// The contexts embedded objects were decoded with, keyed by the objects. Their +// cached JSON-LD stays as it was received, as a proof can cover its context, so +// this is what decoding the objects nested in them has to start from: +const inheritedContexts = new WeakMap(); + +function getCachedJsonLdContext(object: object, context: unknown): unknown { + return inheritedContexts.has(object) + ? inheritedContexts.get(object) + : context; +} + +// Puts the document an embedded object was received as back into its cache, +// after decoding it from the result of inheritJsonLdContext(): +async function keepCachedJsonLd( + object: object, + document: object, + decoded: object, + contextLoader: DocumentLoader, +): Promise { + if (decoded === document) return; + const target = object as unknown as { _cachedJsonLd?: unknown }; + const cached = target._cachedJsonLd; + if (cached == null) return; + inheritedContexts.set(object, (decoded as { "@context"?: unknown })["@context"]); + // The decoder can normalize what it caches, e.g., portable object IRIs: + target._cachedJsonLd = + globalThis.JSON.stringify(cached) === globalThis.JSON.stringify(decoded) + ? structuredClone(document) + : await compactJsonLdCache( + await jsonld.expand(cached, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }), + document, + contextLoader, + ); +} + // Embeds the context of a cached document in a document embedded in it, so // that decoding the embedded document alone resolves its terms the same way // as decoding the whole document did. The parent's context entries keep // their order, as later entries can refer to terms earlier ones define. // When the embedded document's own context already begins with all of them, // it is used as is, since applying the same entries again yields the same -// terms. Property-scoped contexts of the parent are not applied, as the -// embedded document is decoded as a top-level node: +// terms: function inheritJsonLdContext( parentContext: unknown, document: object, @@ -455,6 +492,7 @@ const expandedKeys = new WeakMap>>(); function expandKey( document: Record, + context: unknown, key: string, contextLoader: DocumentLoader, ): Promise { @@ -466,7 +504,7 @@ function expandKey( const cached = keys.get(key); if (cached != null) return cached; const iris = jsonld.expand( - { "@context": document["@context"], [key]: [] }, + { "@context": context, [key]: [] }, { documentLoader: contextLoader, keepFreeFloatingNodes: true }, ).then((expanded: unknown[]) => globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => @@ -488,35 +526,47 @@ function isNonPropagatingContext(context: unknown): boolean { (first as Record)["@propagate"] === false; } +function hasPropertyScopedContext(context: unknown, key: string): boolean { + const entries = globalThis.Array.isArray(context) ? context : [context]; + return entries.some((entry) => { + const term = entry != null && typeof entry === "object" + ? (entry as Record)[key] + : undefined; + return term != null && typeof term === "object" && "@context" in term; + }); +} + // Whether the embedded documents under a key of a compacted document can be // decoded again in place of the values decoded for a property. The document // has to map the key, and no other key, to the property, as a context can // remap the key or map another term to the property, in which case the cached // documents cannot be matched with the decoded values. An inline context // that does not propagate to embedded nodes, in the document or in the -// embedded document, rules it out as well, since prepending another context -// cannot rebuild the contexts they were decoded with: +// embedded document, and a property-scoped context for the key rule it out as +// well, since prepending a context cannot rebuild what they were decoded with: async function isCachedPropertyKey( document: Record, + context: unknown, embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { if ( - isNonPropagatingContext(document["@context"]) || - isNonPropagatingContext((embedded as { "@context"?: unknown })["@context"]) + isNonPropagatingContext(context) || + isNonPropagatingContext((embedded as { "@context"?: unknown })["@context"]) || + hasPropertyScopedContext(context, key) ) { return false; } - const own = await expandKey(document, key, contextLoader); + const own = await expandKey(document, context, key, contextLoader); if (own.length !== 1 || own[0] !== iris[0]) return false; const others = await globalThis.Promise.all( globalThis.Object.keys(document) .filter((k) => k !== key && !k.startsWith("@")) // Keyword aliases, such as id, cannot take an empty array, and are // not properties anyway: - .map((k) => expandKey(document, k, contextLoader).catch(() => [])), + .map((k) => expandKey(document, context, k, contextLoader).catch(() => [])), ); return !others.flat().some((iri) => iris.includes(iri)); } @@ -6430,18 +6480,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "attachment", ["https://www.w3.org/ns/activitystreams#attachment"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#attachment_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -6455,6 +6512,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -6927,18 +6990,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "attributedTo", ["https://www.w3.org/ns/activitystreams#attributedTo"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#attribution_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -6952,6 +7022,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -7105,18 +7181,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "attributedTo", ["https://www.w3.org/ns/activitystreams#attributedTo"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#attribution_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -7130,6 +7213,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -7541,18 +7630,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "audience", ["https://www.w3.org/ns/activitystreams#audience"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#audience_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -7566,6 +7662,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -7718,18 +7820,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "audience", ["https://www.w3.org/ns/activitystreams#audience"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#audience_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -7743,6 +7852,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -8207,18 +8322,25 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "context", ["https://www.w3.org/ns/activitystreams#context"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#context_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -8232,6 +8354,12 @@ get contents(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -8703,18 +8831,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "generator", ["https://www.w3.org/ns/activitystreams#generator"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#generator_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -8728,6 +8863,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9162,18 +9303,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "icon", ["https://www.w3.org/ns/activitystreams#icon"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#icon_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -9187,6 +9335,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9340,18 +9494,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "icon", ["https://www.w3.org/ns/activitystreams#icon"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#icon_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -9365,6 +9526,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9799,18 +9966,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "image", ["https://www.w3.org/ns/activitystreams#image"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#image_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -9824,6 +9998,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -9977,18 +10157,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "image", ["https://www.w3.org/ns/activitystreams#image"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#image_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -10002,6 +10189,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -10428,18 +10621,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "inReplyTo", ["https://www.w3.org/ns/activitystreams#inReplyTo"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#replyTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -10453,6 +10653,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -10605,18 +10811,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "inReplyTo", ["https://www.w3.org/ns/activitystreams#inReplyTo"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#replyTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -10630,6 +10843,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11056,18 +11275,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "location", ["https://www.w3.org/ns/activitystreams#location"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#location_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11081,6 +11307,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11233,18 +11465,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "location", ["https://www.w3.org/ns/activitystreams#location"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#location_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11258,6 +11497,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11683,18 +11928,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "preview", ["https://www.w3.org/ns/activitystreams#preview"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#preview_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11708,6 +11960,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -11859,18 +12117,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "preview", ["https://www.w3.org/ns/activitystreams#preview"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#preview_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -11884,6 +12149,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -12308,18 +12579,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "replies", ["https://www.w3.org/ns/activitystreams#replies"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#replies_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -12333,6 +12611,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -12749,18 +13033,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "shares", ["https://www.w3.org/ns/activitystreams#shares"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#shares_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -12774,6 +13065,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -13190,18 +13487,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "likes", ["https://www.w3.org/ns/activitystreams#likes"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likes_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -13215,6 +13519,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -13625,18 +13935,25 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "emojiReactions", ["http://fedibird.com/ns#emojiReactions"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#emojiReactions_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -13650,6 +13967,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -14121,18 +14444,25 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "tag", ["https://www.w3.org/ns/activitystreams#tag"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#tag_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -14146,6 +14476,12 @@ get summaries(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -14591,18 +14927,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "to", ["https://www.w3.org/ns/activitystreams#to"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#to_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -14616,6 +14959,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -14768,18 +15117,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "to", ["https://www.w3.org/ns/activitystreams#to"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#to_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -14793,6 +15149,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15204,18 +15566,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "bto", ["https://www.w3.org/ns/activitystreams#bto"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#bto_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -15229,6 +15598,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15381,18 +15756,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "bto", ["https://www.w3.org/ns/activitystreams#bto"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#bto_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -15406,6 +15788,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15817,18 +16205,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "cc", ["https://www.w3.org/ns/activitystreams#cc"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#cc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -15842,6 +16237,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -15994,18 +16395,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "cc", ["https://www.w3.org/ns/activitystreams#cc"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#cc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -16019,6 +16427,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -16430,18 +16844,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "bcc", ["https://www.w3.org/ns/activitystreams#bcc"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#bcc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -16455,6 +16876,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -16607,18 +17034,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "bcc", ["https://www.w3.org/ns/activitystreams#bcc"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#bcc_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -16632,6 +17066,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -17106,18 +17546,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "proof", ["https://w3id.org/security#proof"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#proof_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -17131,6 +17578,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -17282,18 +17735,25 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "proof", ["https://w3id.org/security#proof"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#proof_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -17307,6 +17767,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -17757,18 +18223,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "likeAuthorization", ["https://gotosocial.org/ns#likeAuthorization"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likeAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -17782,6 +18255,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -18192,18 +18671,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "replyAuthorization", ["https://gotosocial.org/ns#replyAuthorization"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#replyAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -18217,6 +18703,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -18627,18 +19119,25 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "announceAuthorization", ["https://gotosocial.org/ns#announceAuthorization"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#announceAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -18652,6 +19151,12 @@ get urls(): ((URL | Link))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -25189,18 +25694,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "quote", ["https://w3id.org/fep/044f#quote"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -25214,6 +25726,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -25647,18 +26165,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -25672,6 +26197,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28173,18 +28704,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "actor", ["https://www.w3.org/ns/activitystreams#actor"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#actor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28198,6 +28736,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28351,18 +28895,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "actor", ["https://www.w3.org/ns/activitystreams#actor"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#actor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28376,6 +28927,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28788,18 +29345,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "object", ["https://www.w3.org/ns/activitystreams#object"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28813,6 +29377,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -28966,18 +29536,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "object", ["https://www.w3.org/ns/activitystreams#object"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -28991,6 +29568,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -29406,18 +29989,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "target", ["https://www.w3.org/ns/activitystreams#target"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#target_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -29431,6 +30021,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -29587,18 +30183,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "target", ["https://www.w3.org/ns/activitystreams#target"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#target_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -29612,6 +30215,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30024,18 +30633,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "result", ["https://www.w3.org/ns/activitystreams#result"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#result_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30049,6 +30665,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30202,18 +30824,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "result", ["https://www.w3.org/ns/activitystreams#result"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#result_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30227,6 +30856,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30640,18 +31275,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "origin", ["https://www.w3.org/ns/activitystreams#origin"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#origin_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30665,6 +31307,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -30819,18 +31467,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "origin", ["https://www.w3.org/ns/activitystreams#origin"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#origin_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -30844,6 +31499,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -31255,18 +31916,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "instrument", ["https://www.w3.org/ns/activitystreams#instrument"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#instrument_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -31280,6 +31948,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -31432,18 +32106,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "instrument", ["https://www.w3.org/ns/activitystreams#instrument"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#instrument_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -31457,6 +32138,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -35776,18 +36463,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -35801,6 +36495,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -36210,18 +36910,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -36235,6 +36942,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -40837,18 +41550,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -40862,6 +41582,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -41271,18 +41997,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -41296,6 +42029,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -43201,18 +43940,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -43226,6 +43972,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -43635,18 +44387,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -43660,6 +44419,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -45564,18 +46329,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -45589,6 +46361,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -45998,18 +46776,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -46023,6 +46808,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -48565,18 +49356,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "translator", ["https://schema.org/translator"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#translator_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -48590,6 +49388,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -48746,18 +49550,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "translator", ["https://schema.org/translator"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#translator_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -48771,6 +49582,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -50608,18 +51425,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactingObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -50633,6 +51457,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -51041,18 +51871,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#interactionTarget_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -51066,6 +51903,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -53959,18 +54802,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "current", ["https://www.w3.org/ns/activitystreams#current"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#current_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -53984,6 +54834,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -54394,18 +55250,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "first", ["https://www.w3.org/ns/activitystreams#first"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#first_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -54419,6 +55282,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -54829,18 +55698,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "last", ["https://www.w3.org/ns/activitystreams#last"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#last_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -54854,6 +55730,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -55283,18 +56165,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "items", ["https://www.w3.org/ns/activitystreams#items"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#item_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -55308,6 +56197,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -55718,18 +56613,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "likesOf", ["https://w3id.org/fep/5711#likesOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likesOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -55743,6 +56645,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -56152,18 +57060,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "sharesOf", ["https://w3id.org/fep/5711#sharesOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#sharesOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -56177,6 +57092,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -56586,18 +57507,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "repliesOf", ["https://w3id.org/fep/5711#repliesOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#repliesOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -56611,6 +57539,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -57020,18 +57954,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "inboxOf", ["https://w3id.org/fep/5711#inboxOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inboxOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -57045,6 +57986,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -57454,18 +58401,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "outboxOf", ["https://w3id.org/fep/5711#outboxOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outboxOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -57479,6 +58433,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -57888,18 +58848,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "followersOf", ["https://w3id.org/fep/5711#followersOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followersOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -57913,6 +58880,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -58322,18 +59295,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "followingOf", ["https://w3id.org/fep/5711#followingOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followingOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -58347,6 +59327,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -58756,18 +59742,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "likedOf", ["https://w3id.org/fep/5711#likedOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#likedOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -58781,6 +59774,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -61366,18 +62365,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "orderedItems", ["https://www.w3.org/ns/activitystreams#items"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#item_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -61391,6 +62397,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -63565,18 +64577,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredObject", ["https://w3id.org/fep/7aa9#featuredObject"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredObject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -63590,6 +64609,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -64000,18 +65025,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featureAuthorization", ["https://w3id.org/fep/7aa9#featureAuthorization"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featureAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -64025,6 +65057,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -68623,18 +69661,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "owner", ["https://w3id.org/security#owner"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#owner_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -68648,6 +69693,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -70177,18 +71228,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "controller", ["https://w3id.org/security#controller"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#controller_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -70202,6 +71260,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -80515,18 +81579,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -80540,6 +81611,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -80690,18 +81767,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -80715,6 +81799,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -81128,18 +82218,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -81153,6 +82250,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -81307,18 +82410,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -81332,6 +82442,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -81815,18 +82931,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -81840,6 +82963,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -82273,18 +83402,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -82298,6 +83434,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -82711,18 +83853,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "following", ["https://www.w3.org/ns/activitystreams#following"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -82736,6 +83885,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -83152,18 +84307,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -83177,6 +84339,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -83591,18 +84759,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -83616,6 +84791,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -84028,18 +85209,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featured", ["http://joinmastodon.org/ns#featured"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -84053,6 +85241,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -84465,18 +85659,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -84490,6 +85691,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -84899,18 +86106,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -84924,6 +86138,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -85337,18 +86557,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -85362,6 +86589,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -85917,18 +87150,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -85942,6 +87182,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -86414,18 +87660,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -86439,6 +87692,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -86593,18 +87852,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -86618,6 +87884,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -87031,18 +88303,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -87056,6 +88335,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -87210,18 +88495,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -87235,6 +88527,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -92425,18 +93723,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "quote", ["https://w3id.org/fep/044f#quote"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -92450,6 +93755,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -92883,18 +94194,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -92908,6 +94226,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -97113,18 +98437,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "partOf", ["https://www.w3.org/ns/activitystreams#partOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#partOf_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -97138,6 +98469,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -97546,18 +98883,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "next", ["https://www.w3.org/ns/activitystreams#next"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#next_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -97571,6 +98915,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -97980,18 +99330,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "prev", ["https://www.w3.org/ns/activitystreams#prev"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#prev_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -98005,6 +99362,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107102,18 +108465,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107127,6 +108497,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107277,18 +108653,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107302,6 +108685,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107715,18 +109104,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107740,6 +109136,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -107894,18 +109296,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -107919,6 +109328,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -108402,18 +109817,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -108427,6 +109849,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -108860,18 +110288,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -108885,6 +110320,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -109298,18 +110739,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "following", ["https://www.w3.org/ns/activitystreams#following"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -109323,6 +110771,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -109739,18 +111193,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -109764,6 +111225,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -110178,18 +111645,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -110203,6 +111677,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -110615,18 +112095,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featured", ["http://joinmastodon.org/ns#featured"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -110640,6 +112127,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -111052,18 +112545,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -111077,6 +112577,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -111486,18 +112992,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -111511,6 +113024,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -111924,18 +113443,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -111949,6 +113475,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -112504,18 +114036,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -112529,6 +114068,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113001,18 +114546,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113026,6 +114578,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113180,18 +114738,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113205,6 +114770,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113618,18 +115189,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113643,6 +115221,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -113797,18 +115381,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -113822,6 +115413,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -118868,18 +120465,25 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "preview", ["https://www.w3.org/ns/activitystreams#preview"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#preview_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -118893,6 +120497,12 @@ get names(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -126330,18 +127940,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "quote", ["https://w3id.org/fep/044f#quote"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -126355,6 +127972,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -126788,18 +128411,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -126813,6 +128443,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -128330,18 +129966,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "orderedItems", ["https://www.w3.org/ns/activitystreams#items"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#item_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -128355,6 +129998,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -132257,18 +133906,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -132282,6 +133938,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -132432,18 +134094,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -132457,6 +134126,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -132870,18 +134545,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -132895,6 +134577,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -133049,18 +134737,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -133074,6 +134769,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -133557,18 +135258,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -133582,6 +135290,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -134015,18 +135729,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -134040,6 +135761,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -134453,18 +136180,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "following", ["https://www.w3.org/ns/activitystreams#following"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -134478,6 +136212,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -134894,18 +136634,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -134919,6 +136666,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -135333,18 +137086,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -135358,6 +137118,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -135770,18 +137536,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featured", ["http://joinmastodon.org/ns#featured"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -135795,6 +137568,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -136207,18 +137986,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -136232,6 +138018,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -136641,18 +138433,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -136666,6 +138465,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -137079,18 +138884,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -137104,6 +138916,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -137659,18 +139477,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -137684,6 +139509,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138156,18 +139987,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138181,6 +140019,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138335,18 +140179,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138360,6 +140211,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138773,18 +140630,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138798,6 +140662,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -138952,18 +140822,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -138977,6 +140854,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146072,18 +147955,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146097,6 +147987,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146247,18 +148143,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146272,6 +148175,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146685,18 +148594,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146710,6 +148626,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -146864,18 +148786,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -146889,6 +148818,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -147372,18 +149307,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -147397,6 +149339,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -147830,18 +149778,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -147855,6 +149810,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -148268,18 +150229,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "following", ["https://www.w3.org/ns/activitystreams#following"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -148293,6 +150261,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -148709,18 +150683,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -148734,6 +150715,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -149148,18 +151135,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -149173,6 +151167,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -149585,18 +151585,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featured", ["http://joinmastodon.org/ns#featured"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -149610,6 +151617,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -150022,18 +152035,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -150047,6 +152067,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -150456,18 +152482,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -150481,6 +152514,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -150894,18 +152933,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -150919,6 +152965,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -151474,18 +153526,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -151499,6 +153558,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -151971,18 +154036,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -151996,6 +154068,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -152150,18 +154228,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -152175,6 +154260,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -152588,18 +154679,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -152613,6 +154711,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -152767,18 +154871,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -152792,6 +154903,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -158278,18 +160395,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "describes", ["https://www.w3.org/ns/activitystreams#describes"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#describes_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -158303,6 +160427,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -160055,18 +162185,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "oneOf", ["https://www.w3.org/ns/activitystreams#oneOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#exclusiveOption_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -160080,6 +162217,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -160496,18 +162639,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "anyOf", ["https://www.w3.org/ns/activitystreams#anyOf"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#inclusiveOption_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -160521,6 +162671,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -160963,18 +163119,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "quote", ["https://w3id.org/fep/044f#quote"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quote_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -160988,6 +163151,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -161421,18 +163590,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#quoteAuthorization_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -161446,6 +163622,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -164540,18 +166722,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "subject", ["https://www.w3.org/ns/activitystreams#subject"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#subject_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -164565,6 +166754,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -164974,18 +167169,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "object", ["https://www.w3.org/ns/activitystreams#object"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -164999,6 +167201,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -165150,18 +167358,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "object", ["https://www.w3.org/ns/activitystreams#object"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#object_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -165175,6 +167390,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -165587,18 +167808,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "relationship", ["https://www.w3.org/ns/activitystreams#relationship"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#relationship_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -165612,6 +167840,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -165765,18 +167999,25 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "relationship", ["https://www.w3.org/ns/activitystreams#relationship"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#relationship_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -165790,6 +168031,12 @@ rawPropertyDescriptors.set(this.prototype, descriptors); : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -170339,18 +172586,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -170364,6 +172618,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -170514,18 +172774,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "publicKey", ["https://w3id.org/security#publicKey"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#publicKey_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -170539,6 +172806,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -170952,18 +173225,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -170977,6 +173257,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -171131,18 +173417,25 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#assertionMethod_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -171156,6 +173449,12 @@ get preferredUsernames(): ((string | LanguageString))[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -171639,18 +173938,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#inbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -171664,6 +173970,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -172097,18 +174409,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#outbox_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -172122,6 +174441,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -172535,18 +174860,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "following", ["https://www.w3.org/ns/activitystreams#following"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#following_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -172560,6 +174892,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -172976,18 +175314,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#followers_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -173001,6 +175346,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -173415,18 +175766,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#liked_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -173440,6 +175798,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -173852,18 +176216,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featured", ["http://joinmastodon.org/ns#featured"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featured_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -173877,6 +176248,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -174289,18 +176666,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredTags_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -174314,6 +176698,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -174723,18 +177113,25 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#featuredCollections_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -174748,6 +177145,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -175161,18 +177564,25 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#stream_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -175186,6 +177596,12 @@ get gateways(): (URL)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -175741,18 +178157,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#successor_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -175766,6 +178189,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -176238,18 +178667,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -176263,6 +178699,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -176417,18 +178859,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#alias_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -176442,6 +178891,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -176855,18 +179310,25 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -176880,6 +179342,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -177034,18 +179502,25 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, "service", ["https://www.w3.org/ns/did#service"], - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#service_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -177059,6 +179534,12 @@ get attributionDomains(): (string)[] { : undefined), }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index 872c52c02..22e01e15c 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -491,9 +491,16 @@ async function* generateProperty( const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, doc, ${JSON.stringify(property.compactName)}, ${ @@ -502,12 +509,12 @@ async function* generateProperty( ...(property.redundantProperties ?? []).map((p) => p.uri), ]) }, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, doc); v = await this.#${property.singularName}_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], doc), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -515,6 +522,12 @@ async function* generateProperty( baseUrl: ${cachedPropertyBaseUrl}, }, ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; @@ -691,9 +704,16 @@ async function* generateProperty( const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); if ( await isCachedPropertyKey( this._cachedJsonLd as Record, + context, obj, ${JSON.stringify(property.compactName)}, ${ @@ -702,12 +722,12 @@ async function* generateProperty( ...(property.redundantProperties ?? []).map((p) => p.uri), ]) }, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), + cachedContextLoader, ) ) { + const inherited = inheritJsonLdContext(context, obj); v = await this.#${property.singularName}_fromJsonLd( - inheritJsonLdContext(this._cachedJsonLd["@context"], obj), + inherited, { ...options, // Keep the parent default for embedded objects. @@ -715,6 +735,12 @@ async function* generateProperty( baseUrl: ${cachedPropertyBaseUrl}, }, ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index e9c99af16..e5646c018 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -97,14 +97,51 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } +// The contexts embedded objects were decoded with, keyed by the objects. Their +// cached JSON-LD stays as it was received, as a proof can cover its context, so +// this is what decoding the objects nested in them has to start from: +const inheritedContexts = new WeakMap(); + +function getCachedJsonLdContext(object: object, context: unknown): unknown { + return inheritedContexts.has(object) + ? inheritedContexts.get(object) + : context; +} + +// Puts the document an embedded object was received as back into its cache, +// after decoding it from the result of inheritJsonLdContext(): +async function keepCachedJsonLd( + object: object, + document: object, + decoded: object, + contextLoader: DocumentLoader, +): Promise { + if (decoded === document) return; + const target = object as unknown as { _cachedJsonLd?: unknown }; + const cached = target._cachedJsonLd; + if (cached == null) return; + inheritedContexts.set(object, (decoded as { "@context"?: unknown })["@context"]); + // The decoder can normalize what it caches, e.g., portable object IRIs: + target._cachedJsonLd = + globalThis.JSON.stringify(cached) === globalThis.JSON.stringify(decoded) + ? structuredClone(document) + : await compactJsonLdCache( + await jsonld.expand(cached, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }), + document, + contextLoader, + ); +} + // Embeds the context of a cached document in a document embedded in it, so // that decoding the embedded document alone resolves its terms the same way // as decoding the whole document did. The parent's context entries keep // their order, as later entries can refer to terms earlier ones define. // When the embedded document's own context already begins with all of them, // it is used as is, since applying the same entries again yields the same -// terms. Property-scoped contexts of the parent are not applied, as the -// embedded document is decoded as a top-level node: +// terms: function inheritJsonLdContext( parentContext: unknown, document: object, @@ -132,6 +169,7 @@ const expandedKeys = new WeakMap>>(); function expandKey( document: Record, + context: unknown, key: string, contextLoader: DocumentLoader, ): Promise { @@ -143,7 +181,7 @@ function expandKey( const cached = keys.get(key); if (cached != null) return cached; const iris = jsonld.expand( - { "@context": document["@context"], [key]: [] }, + { "@context": context, [key]: [] }, { documentLoader: contextLoader, keepFreeFloatingNodes: true }, ).then((expanded: unknown[]) => globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => @@ -165,35 +203,47 @@ function isNonPropagatingContext(context: unknown): boolean { (first as Record)["@propagate"] === false; } +function hasPropertyScopedContext(context: unknown, key: string): boolean { + const entries = globalThis.Array.isArray(context) ? context : [context]; + return entries.some((entry) => { + const term = entry != null && typeof entry === "object" + ? (entry as Record)[key] + : undefined; + return term != null && typeof term === "object" && "@context" in term; + }); +} + // Whether the embedded documents under a key of a compacted document can be // decoded again in place of the values decoded for a property. The document // has to map the key, and no other key, to the property, as a context can // remap the key or map another term to the property, in which case the cached // documents cannot be matched with the decoded values. An inline context // that does not propagate to embedded nodes, in the document or in the -// embedded document, rules it out as well, since prepending another context -// cannot rebuild the contexts they were decoded with: +// embedded document, and a property-scoped context for the key rule it out as +// well, since prepending a context cannot rebuild what they were decoded with: async function isCachedPropertyKey( document: Record, + context: unknown, embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { if ( - isNonPropagatingContext(document["@context"]) || - isNonPropagatingContext((embedded as { "@context"?: unknown })["@context"]) + isNonPropagatingContext(context) || + isNonPropagatingContext((embedded as { "@context"?: unknown })["@context"]) || + hasPropertyScopedContext(context, key) ) { return false; } - const own = await expandKey(document, key, contextLoader); + const own = await expandKey(document, context, key, contextLoader); if (own.length !== 1 || own[0] !== iris[0]) return false; const others = await globalThis.Promise.all( globalThis.Object.keys(document) .filter((k) => k !== key && !k.startsWith("@")) // Keyword aliases, such as id, cannot take an empty array, and are // not properties anyway: - .map((k) => expandKey(document, k, contextLoader).catch(() => [])), + .map((k) => expandKey(document, context, k, contextLoader).catch(() => [])), ); return !others.flat().some((iri) => iris.includes(iri)); } diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index f6cc52553..064444e25 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -294,6 +294,89 @@ test("embedded objects keep their own non-propagating contexts", async () => { deepStrictEqual(attachment.contents, ["Hello"]); }); +test("embedded objects keep their cached JSON-LD as received", async () => { + const context = [AS, "https://w3id.org/security/data-integrity/v1"]; + const object = { + "@context": context, + id: "https://example.com/notes/1", + type: "Alias", + content: "Hello", + attachment: { + "@context": AS, + type: "Doc", + "quant:structuredUrl": { "@id": "https://example.com/data/1" }, + }, + }; + const create = await Create.fromJsonLd({ + "@context": [AS, { + Alias: `${AS}#Note`, + Doc: `${AS}#Document`, + quant: QUANT, + }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object, + }); + const note = await create.getObject(); + ok(note instanceof Note); + // A proof can cover the context, so it has to stay as it was received: + deepStrictEqual(await note.toJsonLd(), object); + // Objects nested in it still get the context of the outermost document: + const [attachment] = await Array.fromAsync(note.getAttachments()); + ok(attachment != null); + deepStrictEqual(await getRawPropertyValues(attachment, STRUCTURED_URL), [ + { "@id": "https://example.com/data/1" }, + ]); +}); + +test("embedded portable objects keep their own contexts in the cache", async () => { + const did = "did:key:z6Mkpbx26hCxv3hr2gEz8iCm6SykyBU7wXPa3tTceF2fiFVr"; + const create = await Create.fromJsonLd({ + "@context": [AS, { Alias: `${AS}#Note` }], + id: `ap://${did}/activities/1`, + type: "Create", + actor: `ap://${did}/actor`, + object: { + "@context": AS, + id: `ap://${did}/objects/1`, + type: "Alias", + attributedTo: `ap://${did}/actor`, + content: "Hello", + }, + }); + const note = await create.getObject({ + verifyPortableObject: () => Promise.resolve({ verified: true }), + }); + ok(note instanceof Note); + const jsonLd = await note.toJsonLd() as Record; + deepStrictEqual(jsonLd["@context"], AS); + strictEqual(jsonLd.content, "Hello"); +}); + +test("embedded objects keep values under property-scoped contexts", async () => { + const create = await Create.fromJsonLd({ + "@context": [AS, { + body: `${AS}#content`, + object: { "@id": `${AS}#object`, "@context": { body: null } }, + }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": AS, + id: "https://example.com/notes/1", + type: "Note", + // The property-scoped context of the parent removes this term: + body: "Not the content", + content: "Hello", + }, + }); + const note = await create.getObject(); + ok(note instanceof Note); + deepStrictEqual(note.contents, ["Hello"]); +}); + test("getRawPropertyValues() reads embedded objects under terms of the parent's context", async () => { const note = await Note.fromJsonLd({ "@context": [AS, { extra: `${AS}#attachment`, attachment: null }], diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 1d55e8f63..618ba94ae 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -2234,14 +2234,7 @@ test({ function embeddedPropertyDocument(property: "attachment" | "object") { const context = "https://www.w3.org/ns/activitystreams"; return { - "@context": [context, { - // A property-scoped context applies only while the whole document is - // decoded, so reparsing the cached embedded value alone fails: - [property]: { - "@id": `${context}#${property}`, - "@context": { CustomImage: `${context}#Image` }, - }, - }], + "@context": context, type: property === "attachment" ? "Note" : "Create", [property]: [ { @@ -2255,12 +2248,31 @@ function embeddedPropertyDocument(property: "attachment" | "object") { }; } +// Decodes a document whose first embedded object is valid, and then gives the +// decoded object a cache whose first embedded object cannot be decoded: +async function fromJsonLdWithMalformedCache( + fromJsonLd: (json: unknown) => Promise, + property: "attachment" | "object", +): Promise { + const jsonLd = embeddedPropertyDocument(property); + const [, ...rest] = jsonLd[property] as unknown[]; + const decoded = await fromJsonLd({ + ...jsonLd, + [property]: [{ type: "Image", name: "Malformed when reparsed" }, ...rest], + }); + (decoded as unknown as { _cachedJsonLd: unknown })._cachedJsonLd = jsonLd; + return decoded; +} + for (const suppressError of [undefined, false, true]) { test( `Note.getAttachments() cached parse failure (suppressError: ${suppressError})`, async () => { const jsonLd = embeddedPropertyDocument("attachment"); - const note = await Note.fromJsonLd(jsonLd); + const note = await fromJsonLdWithMalformedCache( + (json) => Note.fromJsonLd(json), + "attachment", + ); if (suppressError) { for (let i = 0; i < 2; i++) { const attachments: (Object | Link | PropertyValue)[] = await Array @@ -2288,7 +2300,10 @@ for (const suppressError of [undefined, false, true]) { `Activity.getObject() cached parse failure (suppressError: ${suppressError})`, async () => { const jsonLd = embeddedPropertyDocument("object"); - const activity = await Activity.fromJsonLd(jsonLd); + const activity = await fromJsonLdWithMalformedCache( + (json) => Activity.fromJsonLd(json), + "object", + ); if (suppressError) { deepStrictEqual(await activity.getObject({ suppressError }), null); deepStrictEqual(await activity.getObject({ suppressError }), null); @@ -2302,7 +2317,10 @@ for (const suppressError of [undefined, false, true]) { } test("Note.getAttachments() suppresses cached context loader failures", async () => { - const note = await Note.fromJsonLd(embeddedPropertyDocument("attachment")); + const note = await fromJsonLdWithMalformedCache( + (json) => Note.fromJsonLd(json), + "attachment", + ); const contextLoader = () => Promise.reject(new Error("Context loader failed")); await rejects( @@ -2319,8 +2337,9 @@ test("Note.getAttachments() suppresses cached context loader failures", async () }); test("Activity.getObject() suppresses cached context loader failures", async () => { - const activity = await Activity.fromJsonLd( - embeddedPropertyDocument("object"), + const activity = await fromJsonLdWithMalformedCache( + (json) => Activity.fromJsonLd(json), + "object", ); const contextLoader = () => Promise.reject(new Error("Context loader failed")); From 4a56ef4a91bca31b726be73da3fc772c2597e14b Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 6 Nov 2026 20:51:45 +0900 Subject: [PATCH 30/35] Bound context loads when checking cached keys To tell whether a cached embedded document can be decoded again, the accessor expanded every key of the parent's cached JSON-LD on its own. Each expansion can load the remote contexts again, and the default document loader does not cache them, so a document from a remote peer could multiply outbound requests by its field count: 100 extension fields caused 106 loads of the same context. The check now takes at most two expansions per property, whatever the document holds: one for the key itself and one for all the others. The latter replaces object and array values with empty arrays, so contexts in nested values are not loaded either, and keeps scalars for keyword aliases such as id. If that probe cannot be expanded, the accessor keeps the object decoded with the whole document. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4491321053 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 90 ++++++++++++------- .../src/__snapshots__/class.test.ts.node.snap | 90 ++++++++++++------- .../src/__snapshots__/class.test.ts.snap | 90 ++++++++++++------- packages/vocab-tools/src/raw-property.ts | 90 ++++++++++++------- packages/vocab/src/raw-property.test.ts | 35 +++++++- 5 files changed, 262 insertions(+), 133 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 24325a0c6..1608aa771 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -486,37 +486,51 @@ function inheritJsonLdContext( return { ...document, \\"@context\\": [...parentEntries, ...ownEntries] }; } -// The property IRIs each key of a compacted document expands to, keyed by -// the document: -const expandedKeys = new WeakMap>>(); +// The results of isCachedPropertyKey(), keyed by the document and then by the +// key: +const cachedPropertyKeys = new WeakMap>>(); -function expandKey( +async function expandTopLevelKeys( + document: Record, + contextLoader: DocumentLoader, +): Promise { + const expanded = await jsonld.expand(document, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + return globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => + !iri.startsWith(\\"@\\") + ); +} + +// The number of expansions must not depend on the document, which can come +// from a remote peer, as each of them can load the contexts again: +async function mapsOnlyKeyToProperty( document: Record, context: unknown, key: string, + iris: readonly string[], contextLoader: DocumentLoader, -): Promise { - let keys = expandedKeys.get(document); - if (keys == null) { - keys = new Map(); - expandedKeys.set(document, keys); - } - const cached = keys.get(key); - if (cached != null) return cached; - const iris = jsonld.expand( +): Promise { + const own = await expandTopLevelKeys( { \\"@context\\": context, [key]: [] }, - { documentLoader: contextLoader, keepFreeFloatingNodes: true }, - ).then((expanded: unknown[]) => - globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => - !iri.startsWith(\\"@\\") - ) + contextLoader, ); - // A failure, such as of the context loader, is not remembered, as another - // call can pass another loader: - const map = keys; - iris.catch(() => map.delete(key)); - keys.set(key, iris); - return iris; + if (own.length !== 1 || own[0] !== iris[0]) return false; + // Only the keys matter, so nested values and their contexts are left out, + // while scalars stay for keyword aliases such as id, which require them: + const others: Record = { \\"@context\\": context }; + for (const [k, value] of globalThis.Object.entries(document)) { + if (k === key || k.startsWith(\\"@\\")) continue; + others[k] = value != null && typeof value === \\"object\\" ? [] : value; + } + try { + const expanded = await expandTopLevelKeys(others, contextLoader); + return !expanded.some((iri) => iris.includes(iri)); + } catch { + // Some other term could not take the placeholder, so nothing is known: + return false; + } } // Only the first entry of a context can declare that it does not propagate: @@ -559,16 +573,26 @@ async function isCachedPropertyKey( ) { return false; } - const own = await expandKey(document, context, key, contextLoader); - if (own.length !== 1 || own[0] !== iris[0]) return false; - const others = await globalThis.Promise.all( - globalThis.Object.keys(document) - .filter((k) => k !== key && !k.startsWith(\\"@\\")) - // Keyword aliases, such as id, cannot take an empty array, and are - // not properties anyway: - .map((k) => expandKey(document, context, k, contextLoader).catch(() => [])), + let checks = cachedPropertyKeys.get(document); + if (checks == null) { + checks = new Map(); + cachedPropertyKeys.set(document, checks); + } + const cached = checks.get(key); + if (cached != null) return await cached; + const check = mapsOnlyKeyToProperty( + document, + context, + key, + iris, + contextLoader, ); - return !others.flat().some((iri) => iris.includes(iri)); + // A failure, such as of the context loader, is not remembered, as another + // call can pass another loader: + const map = checks; + check.catch(() => map.delete(key)); + checks.set(key, check); + return await check; } async function readRawProperty( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index f0b9d1f6a..a32fce64c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -484,37 +484,51 @@ function inheritJsonLdContext( return { ...document, \\"@context\\": [...parentEntries, ...ownEntries] }; } -// The property IRIs each key of a compacted document expands to, keyed by -// the document: -const expandedKeys = new WeakMap>>(); +// The results of isCachedPropertyKey(), keyed by the document and then by the +// key: +const cachedPropertyKeys = new WeakMap>>(); -function expandKey( +async function expandTopLevelKeys( + document: Record, + contextLoader: DocumentLoader, +): Promise { + const expanded = await jsonld.expand(document, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + return globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => + !iri.startsWith(\\"@\\") + ); +} + +// The number of expansions must not depend on the document, which can come +// from a remote peer, as each of them can load the contexts again: +async function mapsOnlyKeyToProperty( document: Record, context: unknown, key: string, + iris: readonly string[], contextLoader: DocumentLoader, -): Promise { - let keys = expandedKeys.get(document); - if (keys == null) { - keys = new Map(); - expandedKeys.set(document, keys); - } - const cached = keys.get(key); - if (cached != null) return cached; - const iris = jsonld.expand( +): Promise { + const own = await expandTopLevelKeys( { \\"@context\\": context, [key]: [] }, - { documentLoader: contextLoader, keepFreeFloatingNodes: true }, - ).then((expanded: unknown[]) => - globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => - !iri.startsWith(\\"@\\") - ) + contextLoader, ); - // A failure, such as of the context loader, is not remembered, as another - // call can pass another loader: - const map = keys; - iris.catch(() => map.delete(key)); - keys.set(key, iris); - return iris; + if (own.length !== 1 || own[0] !== iris[0]) return false; + // Only the keys matter, so nested values and their contexts are left out, + // while scalars stay for keyword aliases such as id, which require them: + const others: Record = { \\"@context\\": context }; + for (const [k, value] of globalThis.Object.entries(document)) { + if (k === key || k.startsWith(\\"@\\")) continue; + others[k] = value != null && typeof value === \\"object\\" ? [] : value; + } + try { + const expanded = await expandTopLevelKeys(others, contextLoader); + return !expanded.some((iri) => iris.includes(iri)); + } catch { + // Some other term could not take the placeholder, so nothing is known: + return false; + } } // Only the first entry of a context can declare that it does not propagate: @@ -557,16 +571,26 @@ async function isCachedPropertyKey( ) { return false; } - const own = await expandKey(document, context, key, contextLoader); - if (own.length !== 1 || own[0] !== iris[0]) return false; - const others = await globalThis.Promise.all( - globalThis.Object.keys(document) - .filter((k) => k !== key && !k.startsWith(\\"@\\")) - // Keyword aliases, such as id, cannot take an empty array, and are - // not properties anyway: - .map((k) => expandKey(document, context, k, contextLoader).catch(() => [])), + let checks = cachedPropertyKeys.get(document); + if (checks == null) { + checks = new Map(); + cachedPropertyKeys.set(document, checks); + } + const cached = checks.get(key); + if (cached != null) return await cached; + const check = mapsOnlyKeyToProperty( + document, + context, + key, + iris, + contextLoader, ); - return !others.flat().some((iri) => iris.includes(iri)); + // A failure, such as of the context loader, is not remembered, as another + // call can pass another loader: + const map = checks; + check.catch(() => map.delete(key)); + checks.set(key, check); + return await check; } async function readRawProperty( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 2dcb4d518..eed0c47f9 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -486,37 +486,51 @@ function inheritJsonLdContext( return { ...document, "@context": [...parentEntries, ...ownEntries] }; } -// The property IRIs each key of a compacted document expands to, keyed by -// the document: -const expandedKeys = new WeakMap>>(); +// The results of isCachedPropertyKey(), keyed by the document and then by the +// key: +const cachedPropertyKeys = new WeakMap>>(); -function expandKey( +async function expandTopLevelKeys( + document: Record, + contextLoader: DocumentLoader, +): Promise { + const expanded = await jsonld.expand(document, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + return globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => + !iri.startsWith("@") + ); +} + +// The number of expansions must not depend on the document, which can come +// from a remote peer, as each of them can load the contexts again: +async function mapsOnlyKeyToProperty( document: Record, context: unknown, key: string, + iris: readonly string[], contextLoader: DocumentLoader, -): Promise { - let keys = expandedKeys.get(document); - if (keys == null) { - keys = new Map(); - expandedKeys.set(document, keys); - } - const cached = keys.get(key); - if (cached != null) return cached; - const iris = jsonld.expand( +): Promise { + const own = await expandTopLevelKeys( { "@context": context, [key]: [] }, - { documentLoader: contextLoader, keepFreeFloatingNodes: true }, - ).then((expanded: unknown[]) => - globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => - !iri.startsWith("@") - ) + contextLoader, ); - // A failure, such as of the context loader, is not remembered, as another - // call can pass another loader: - const map = keys; - iris.catch(() => map.delete(key)); - keys.set(key, iris); - return iris; + if (own.length !== 1 || own[0] !== iris[0]) return false; + // Only the keys matter, so nested values and their contexts are left out, + // while scalars stay for keyword aliases such as id, which require them: + const others: Record = { "@context": context }; + for (const [k, value] of globalThis.Object.entries(document)) { + if (k === key || k.startsWith("@")) continue; + others[k] = value != null && typeof value === "object" ? [] : value; + } + try { + const expanded = await expandTopLevelKeys(others, contextLoader); + return !expanded.some((iri) => iris.includes(iri)); + } catch { + // Some other term could not take the placeholder, so nothing is known: + return false; + } } // Only the first entry of a context can declare that it does not propagate: @@ -559,16 +573,26 @@ async function isCachedPropertyKey( ) { return false; } - const own = await expandKey(document, context, key, contextLoader); - if (own.length !== 1 || own[0] !== iris[0]) return false; - const others = await globalThis.Promise.all( - globalThis.Object.keys(document) - .filter((k) => k !== key && !k.startsWith("@")) - // Keyword aliases, such as id, cannot take an empty array, and are - // not properties anyway: - .map((k) => expandKey(document, context, k, contextLoader).catch(() => [])), + let checks = cachedPropertyKeys.get(document); + if (checks == null) { + checks = new Map(); + cachedPropertyKeys.set(document, checks); + } + const cached = checks.get(key); + if (cached != null) return await cached; + const check = mapsOnlyKeyToProperty( + document, + context, + key, + iris, + contextLoader, ); - return !others.flat().some((iri) => iris.includes(iri)); + // A failure, such as of the context loader, is not remembered, as another + // call can pass another loader: + const map = checks; + check.catch(() => map.delete(key)); + checks.set(key, check); + return await check; } async function readRawProperty( diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index e5646c018..ab0782110 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -163,37 +163,51 @@ function inheritJsonLdContext( return { ...document, "@context": [...parentEntries, ...ownEntries] }; } -// The property IRIs each key of a compacted document expands to, keyed by -// the document: -const expandedKeys = new WeakMap>>(); +// The results of isCachedPropertyKey(), keyed by the document and then by the +// key: +const cachedPropertyKeys = new WeakMap>>(); -function expandKey( +async function expandTopLevelKeys( + document: Record, + contextLoader: DocumentLoader, +): Promise { + const expanded = await jsonld.expand(document, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + return globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => + !iri.startsWith("@") + ); +} + +// The number of expansions must not depend on the document, which can come +// from a remote peer, as each of them can load the contexts again: +async function mapsOnlyKeyToProperty( document: Record, context: unknown, key: string, + iris: readonly string[], contextLoader: DocumentLoader, -): Promise { - let keys = expandedKeys.get(document); - if (keys == null) { - keys = new Map(); - expandedKeys.set(document, keys); - } - const cached = keys.get(key); - if (cached != null) return cached; - const iris = jsonld.expand( +): Promise { + const own = await expandTopLevelKeys( { "@context": context, [key]: [] }, - { documentLoader: contextLoader, keepFreeFloatingNodes: true }, - ).then((expanded: unknown[]) => - globalThis.Object.keys(expanded[0] ?? {}).filter((iri) => - !iri.startsWith("@") - ) + contextLoader, ); - // A failure, such as of the context loader, is not remembered, as another - // call can pass another loader: - const map = keys; - iris.catch(() => map.delete(key)); - keys.set(key, iris); - return iris; + if (own.length !== 1 || own[0] !== iris[0]) return false; + // Only the keys matter, so nested values and their contexts are left out, + // while scalars stay for keyword aliases such as id, which require them: + const others: Record = { "@context": context }; + for (const [k, value] of globalThis.Object.entries(document)) { + if (k === key || k.startsWith("@")) continue; + others[k] = value != null && typeof value === "object" ? [] : value; + } + try { + const expanded = await expandTopLevelKeys(others, contextLoader); + return !expanded.some((iri) => iris.includes(iri)); + } catch { + // Some other term could not take the placeholder, so nothing is known: + return false; + } } // Only the first entry of a context can declare that it does not propagate: @@ -236,16 +250,26 @@ async function isCachedPropertyKey( ) { return false; } - const own = await expandKey(document, context, key, contextLoader); - if (own.length !== 1 || own[0] !== iris[0]) return false; - const others = await globalThis.Promise.all( - globalThis.Object.keys(document) - .filter((k) => k !== key && !k.startsWith("@")) - // Keyword aliases, such as id, cannot take an empty array, and are - // not properties anyway: - .map((k) => expandKey(document, context, k, contextLoader).catch(() => [])), + let checks = cachedPropertyKeys.get(document); + if (checks == null) { + checks = new Map(); + cachedPropertyKeys.set(document, checks); + } + const cached = checks.get(key); + if (cached != null) return await cached; + const check = mapsOnlyKeyToProperty( + document, + context, + key, + iris, + contextLoader, ); - return !others.flat().some((iri) => iris.includes(iri)); + // A failure, such as of the context loader, is not remembered, as another + // call can pass another loader: + const map = checks; + check.catch(() => map.delete(key)); + checks.set(key, check); + return await check; } async function readRawProperty( diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index 064444e25..7106787d8 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -1,4 +1,4 @@ -import { test } from "@fedify/fixture"; +import { mockDocumentLoader, test } from "@fedify/fixture"; import { LanguageString } from "@fedify/vocab-runtime"; import { configure, type LogRecord, reset } from "@logtape/logtape"; import { deepStrictEqual, ok, rejects, strictEqual } from "node:assert/strict"; @@ -354,6 +354,39 @@ test("embedded portable objects keep their own contexts in the cache", async () strictEqual(jsonLd.content, "Hello"); }); +test("accessors do not load contexts once per field of a cached document", async () => { + const context = "https://example.com/contexts/extension"; + let loads = 0; + const contextLoader = (url: string) => { + if (url !== context) return mockDocumentLoader(url); + loads++; + return Promise.resolve({ + contextUrl: null, + documentUrl: url, + document: { "@context": { ext: "https://example.com/ns#" } }, + }); + }; + const create = await Create.fromJsonLd({ + "@context": [AS, context], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + ...Object.fromEntries( + Array.from({ length: 100 }, (_, i) => [`ext:field${i}`, i]), + ), + object: { + "@context": AS, + id: "https://example.com/notes/1", + type: "Note", + content: "Hello", + }, + }, { contextLoader }); + loads = 0; + const note = await create.getObject({ contextLoader }); + ok(note instanceof Note); + ok(loads <= 5, `Loaded the context ${loads} times.`); +}); + test("embedded objects keep values under property-scoped contexts", async () => { const create = await Create.fromJsonLd({ "@context": [AS, { From 79f49c570fcbbf71686c8f5f44837dc9f851797c Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 6 Nov 2026 20:52:21 +0900 Subject: [PATCH 31/35] Visit enum members once in IRI lint typescript-eslint exposes enum members both on TSEnumBody and through a deprecated copy on TSEnumDeclaration, and the rule traversed both, so a call in an enum initializer was reported twice. The rule now skips the copy when the declaration has a body, and reads the members from the body first, which also avoids the deprecated accessor. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4491263990 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 9 ++++++++- packages/lint/src/tests/raw-property-iri-invalid.test.ts | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 99f84e601..44d7b5d67 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -119,6 +119,13 @@ function children(node: Ast): Ast[] { for (const key of keys) { // ESTree providers attach the token and comment arrays to Program: if (key === "parent" || key === "tokens" || key === "comments") continue; + // typescript-eslint keeps a deprecated copy of TSEnumBody.members here: + if ( + key === "members" && node.type === "TSEnumDeclaration" && + ast(node.body) != null + ) { + continue; + } const value = node[key]; if (Array.isArray(value)) { for (const item of value) { @@ -363,7 +370,7 @@ export function checkRawPropertyIris( if (node.type === "TSEnumDeclaration") { // Initializers can refer to members by their bare names: const body = ast(node.body); - const members = (node.members ?? body?.members ?? []) as Ast[]; + const members = (body?.members ?? node.members ?? []) as Ast[]; for (const member of members) { const id = name(member.id); if (id == null) continue; diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index 161ac7993..ece7faac6 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -310,6 +310,13 @@ test("ESLint: modules option includes defaults and accepts frozen options", () = ); }); +test("ESLint: enum initializers are reported once", () => { + assert.equal( + verify(`${setup} enum E { V = (read(obj, "content"), 0) }`).length, + 1, + ); +}); + test("ESLint: compact prefixes offer suggestions, never autofixes", () => { const code = `${setup} read(obj, "as:content");`; const [diagnostic] = verify(code); From bc837058ff2b597d033892dd960ab9b113707bbe Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Sat, 7 Nov 2026 00:15:05 +0900 Subject: [PATCH 32/35] Keep received JSON-LD when contexts cannot be rebuilt When a non-propagating or property-scoped context kept an accessor from decoding a cached embedded document again, it returned the object decoded with the whole document. That object has no cache, so its toJsonLd() result was rebuilt from typed values and lost the unsupported fields a proof can cover, which the former standalone reparse kept. Whether the cached document matches the property and whether it can be decoded again are now separate checks. A matching document that cannot be decoded again becomes the cache of the object decoded with the whole document, and that object and the ones nested in it are not decoded again from such a cache. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4492209231 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 8909 ++++++++++------- .../src/__snapshots__/class.test.ts.node.snap | 8909 ++++++++++------- .../src/__snapshots__/class.test.ts.snap | 8909 ++++++++++------- packages/vocab-tools/src/property.ts | 88 +- packages/vocab-tools/src/raw-property.ts | 57 +- packages/vocab/src/raw-property.test.ts | 28 + 6 files changed, 16329 insertions(+), 10571 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 1608aa771..f6fe9c1cb 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -540,6 +540,42 @@ function isNonPropagatingContext(context: unknown): boolean { (first as Record)[\\"@propagate\\"] === false; } +// Objects whose contexts could not be rebuilt, so that neither they nor the +// objects nested in them can be decoded again from their cached JSON-LD: +const fixedCachedJsonLd = new WeakSet(); + +// Whether an embedded document under a key of the cached JSON-LD of an object +// can be decoded again. Prepending a context cannot rebuild what a context +// that does not propagate to embedded nodes, in the document or in the embedded +// document, or a property-scoped context for the key took part in: +function canDecodeCachedJsonLd( + object: object, + context: unknown, + embedded: object, + key: string, +): boolean { + return !fixedCachedJsonLd.has(object) && + !isNonPropagatingContext(context) && + !isNonPropagatingContext( + (embedded as { \\"@context\\"?: unknown })[\\"@context\\"], + ) && + !hasPropertyScopedContext(context, key); +} + +// Gives an object decoded with the whole document the document it was received +// as, which a proof can cover, when it cannot be decoded from that document: +function fixCachedJsonLd(object: unknown, document: object): void { + if ( + object == null || typeof object !== \\"object\\" || + !(RAW_PROPERTY_PROTOCOL in object) + ) { + return; + } + (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = + structuredClone(document); + fixedCachedJsonLd.add(object); +} + function hasPropertyScopedContext(context: unknown, key: string): boolean { const entries = globalThis.Array.isArray(context) ? context : [context]; return entries.some((entry) => { @@ -550,29 +586,18 @@ function hasPropertyScopedContext(context: unknown, key: string): boolean { }); } -// Whether the embedded documents under a key of a compacted document can be -// decoded again in place of the values decoded for a property. The document -// has to map the key, and no other key, to the property, as a context can -// remap the key or map another term to the property, in which case the cached -// documents cannot be matched with the decoded values. An inline context -// that does not propagate to embedded nodes, in the document or in the -// embedded document, and a property-scoped context for the key rule it out as -// well, since prepending a context cannot rebuild what they were decoded with: +// Whether the embedded documents under a key of a compacted document are the +// values decoded for a property. The document has to map the key, and no other +// key, to the property, as a context can remap the key or map another term to +// the property, in which case the cached documents cannot be matched with the +// decoded values: async function isCachedPropertyKey( document: Record, context: unknown, - embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { - if ( - isNonPropagatingContext(context) || - isNonPropagatingContext((embedded as { \\"@context\\"?: unknown })[\\"@context\\"]) || - hasPropertyScopedContext(context, key) - ) { - return false; - } let checks = cachedPropertyKeys.get(document); if (checks == null) { checks = new Map(); @@ -6514,34 +6539,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"attachment\\", [\\"https://www.w3.org/ns/activitystreams#attachment\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attachment_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"attachment\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#attachment_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7024,34 +7059,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"attributedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#attribution_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7215,34 +7260,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"attributedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#attribution_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7664,34 +7719,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"audience\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#audience_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7854,34 +7919,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"audience\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#audience_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -8356,34 +8431,44 @@ get contents(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"context\\", [\\"https://www.w3.org/ns/activitystreams#context\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#context_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"context\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#context_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -8865,34 +8950,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"generator\\", [\\"https://www.w3.org/ns/activitystreams#generator\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#generator_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"generator\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#generator_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -9337,34 +9432,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"icon\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#icon_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -9528,34 +9633,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"icon\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#icon_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10000,34 +10115,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"image\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#image_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10191,34 +10316,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"image\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#image_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10655,34 +10790,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inReplyTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#replyTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10845,34 +10990,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"inReplyTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#replyTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -11309,34 +11464,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"location\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#location_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -11499,34 +11664,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"location\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#location_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -11962,34 +12137,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"preview\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#preview_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -12151,34 +12336,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"preview\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#preview_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -12613,34 +12808,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"replies\\", [\\"https://www.w3.org/ns/activitystreams#replies\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replies_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"replies\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#replies_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -13067,34 +13272,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"shares\\", [\\"https://www.w3.org/ns/activitystreams#shares\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#shares_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"shares\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#shares_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -13521,34 +13736,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"likes\\", [\\"https://www.w3.org/ns/activitystreams#likes\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likes_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"likes\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likes_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -13969,34 +14194,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"emojiReactions\\", [\\"http://fedibird.com/ns#emojiReactions\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#emojiReactions_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"emojiReactions\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#emojiReactions_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -14478,34 +14713,44 @@ get summaries(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"tag\\", [\\"https://www.w3.org/ns/activitystreams#tag\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#tag_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"tag\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#tag_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -14961,34 +15206,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"to\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#to_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -15151,34 +15406,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"to\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#to_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -15600,34 +15865,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"bto\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#bto_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -15790,34 +16065,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"bto\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#bto_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -16239,34 +16524,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"cc\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#cc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -16429,34 +16724,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"cc\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#cc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -16878,34 +17183,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"bcc\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#bcc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -17068,34 +17383,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"bcc\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#bcc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -17580,34 +17905,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"proof\\", [\\"https://w3id.org/security#proof\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"proof\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#proof_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -17769,34 +18104,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"proof\\", [\\"https://w3id.org/security#proof\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"proof\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#proof_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -18257,34 +18602,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"likeAuthorization\\", [\\"https://gotosocial.org/ns#likeAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likeAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"likeAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likeAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -18705,34 +19060,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"replyAuthorization\\", [\\"https://gotosocial.org/ns#replyAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"replyAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#replyAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -19153,34 +19518,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"announceAuthorization\\", [\\"https://gotosocial.org/ns#announceAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#announceAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"announceAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#announceAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -25728,34 +26103,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quote\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -26199,34 +26584,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quoteAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -28738,34 +29133,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"actor\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#actor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -28929,34 +29334,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"actor\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#actor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -29379,34 +29794,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"object\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -29570,34 +29995,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"object\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30023,34 +30458,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"target\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#target_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30217,34 +30662,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"target\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#target_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30667,34 +31122,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"result\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#result_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30858,34 +31323,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"result\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#result_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -31309,34 +31784,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"origin\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#origin_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -31501,34 +31986,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"origin\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#origin_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -31950,203 +32445,20 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#instrument_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); - } - } catch (error) { - if (!options.suppressError) throw error; - getLogger([\\"fedify\\", \\"vocab\\"]).debug( - \\"Failed to parse embedded value of {property}: {error}\\", - { property: \\"https://www.w3.org/ns/activitystreams#instrument\\", error }, - ); - return null; - } - } - } - - if (v?.id != null && - ((this.id != null && !isTrustedIriOrigin(options, v.id, this.id)) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject( - this, this.id, v.id, options, - )) && - !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { - if (options.crossOrigin === \\"throw\\") { - throw new Error( - \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + - \\"origin than the property owner's @id (\\" + (this.id?.href ?? null) + \\"); \\" + - \\"refusing to return the object. If you want to bypass this \\" + - \\"check and are aware of the security implications, set the \\" + - 'crossOrigin option to \\"trust\\".' - ); - } - getLogger([\\"fedify\\", \\"vocab\\"]).warn( - \\"The property object's @id ({objectId}) has a different origin \\" + - \\"than the property owner's @id ({parentObjectId}); refusing to \\" + - \\"return the object. If you want to bypass this check and are \\" + - \\"aware of the security implications, set the crossOrigin option \\" + - 'to \\"trust\\".', - { objectId: v.id.href, parentObjectId: (this.id?.href ?? null) }, - ); - return null; - } - recordPortableReferrer(this, v, \\"https://www.w3.org/ns/activitystreams#instrument\\"); - return v; - } - - /** - * Similar to - * {@link Activity.getInstruments}, - * but returns their \`@id\`s instead of the objects themselves. - */ - get instrumentIds(): URL[] { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - return this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.map((v) => - v instanceof URL ? v : v.id! - ).filter(id => id !== null); - } - -/** Identifies one or more objects used (or to be used) in the completion of - * an {@link Activity}. - * - */ - - async* getInstruments( - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - suppressError?: boolean, - tracerProvider?: TracerProvider, - crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\"; - gateways?: readonly (string | URL)[]; - verifyPortableObject?: PortableObjectVerifier; - /** - * Whether objects that this call newly fetches use the - * \`verifyPortableObject\` option of this call as their default - * verifier. Defaults to \`true\`. If \`false\`, the option - * applies to this call only, and fetched objects use this object's - * own default verifier, if any, as their default instead. Pass - * \`false\` for a temporary verifier, e.g., one that accepts - * everything. Objects that were already cached in this object or - * embedded in it keep their defaults either way, and this option - * itself is not passed on. - * @since 2.4.0 - */ - inheritPortableObjectVerifier?: boolean; - } = {} - ): AsyncIterable { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - if ( - options.verifyPortableObject == null && - this._verifyPortableObject != null - ) { - options = { - ...options, - verifyPortableObject: this._verifyPortableObject, - }; - } - const vs = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; - for (let i = 0; i < vs.length; i++) { - let v = vs[i]; - if (!(v instanceof URL) && - !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { - if (v.id == null) { - if (isUnsecuredPortableObject(this)) { - warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#instrument\\"); - continue; - } - } else if ( - !isTrustedIriOrigin(options, v.id, this.id) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject(this, this.id, v.id, options) - ) { - v = v.id; - } - } - if (v instanceof URL) { - const fetched = - await this.#fetchInstrument(v, options); - if (fetched == null) continue; - // Not cached, so that it is verified when the portable object - // policy applies later: - if (isUnverifiedPortableClaim(fetched)) { - yield fetched; - continue; - } - vs[i] = fetched; - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); - this._cachedJsonLd = undefined; - recordPortableReferrer(this, fetched, \\"https://www.w3.org/ns/activitystreams#instrument\\"); - yield fetched; - continue; - } - - if ( - this._cachedJsonLd != null && - typeof this._cachedJsonLd === \\"object\\" && - \\"@context\\" in this._cachedJsonLd && - \\"instrument\\" in this._cachedJsonLd - ) { - const prop = this._cachedJsonLd[ - \\"instrument\\"]; - const obj = Array.isArray(prop) ? prop[i] : prop; - if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); - const context = getCachedJsonLdContext( - this, - this._cachedJsonLd[\\"@context\\"], - ); if ( - await isCachedPropertyKey( - this._cachedJsonLd as Record, + canDecodeCachedJsonLd( + this, context, - obj, + doc, \\"instrument\\", - [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); + const inherited = inheritJsonLdContext(context, doc); v = await this.#instrument_fromJsonLd( inherited, { @@ -32164,10 +32476,213 @@ rawPropertyDescriptors.set(this.prototype, descriptors); ); await keepCachedJsonLd( v as object, - obj, + doc, inherited, cachedContextLoader, ); + } else { + fixCachedJsonLd(v, doc); + } + } + } catch (error) { + if (!options.suppressError) throw error; + getLogger([\\"fedify\\", \\"vocab\\"]).debug( + \\"Failed to parse embedded value of {property}: {error}\\", + { property: \\"https://www.w3.org/ns/activitystreams#instrument\\", error }, + ); + return null; + } + } + } + + if (v?.id != null && + ((this.id != null && !isTrustedIriOrigin(options, v.id, this.id)) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject( + this, this.id, v.id, options, + )) && + !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { + if (options.crossOrigin === \\"throw\\") { + throw new Error( + \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + + \\"origin than the property owner's @id (\\" + (this.id?.href ?? null) + \\"); \\" + + \\"refusing to return the object. If you want to bypass this \\" + + \\"check and are aware of the security implications, set the \\" + + 'crossOrigin option to \\"trust\\".' + ); + } + getLogger([\\"fedify\\", \\"vocab\\"]).warn( + \\"The property object's @id ({objectId}) has a different origin \\" + + \\"than the property owner's @id ({parentObjectId}); refusing to \\" + + \\"return the object. If you want to bypass this check and are \\" + + \\"aware of the security implications, set the crossOrigin option \\" + + 'to \\"trust\\".', + { objectId: v.id.href, parentObjectId: (this.id?.href ?? null) }, + ); + return null; + } + recordPortableReferrer(this, v, \\"https://www.w3.org/ns/activitystreams#instrument\\"); + return v; + } + + /** + * Similar to + * {@link Activity.getInstruments}, + * but returns their \`@id\`s instead of the objects themselves. + */ + get instrumentIds(): URL[] { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + return this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.map((v) => + v instanceof URL ? v : v.id! + ).filter(id => id !== null); + } + +/** Identifies one or more objects used (or to be used) in the completion of + * an {@link Activity}. + * + */ + + async* getInstruments( + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + suppressError?: boolean, + tracerProvider?: TracerProvider, + crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\"; + gateways?: readonly (string | URL)[]; + verifyPortableObject?: PortableObjectVerifier; + /** + * Whether objects that this call newly fetches use the + * \`verifyPortableObject\` option of this call as their default + * verifier. Defaults to \`true\`. If \`false\`, the option + * applies to this call only, and fetched objects use this object's + * own default verifier, if any, as their default instead. Pass + * \`false\` for a temporary verifier, e.g., one that accepts + * everything. Objects that were already cached in this object or + * embedded in it keep their defaults either way, and this option + * itself is not passed on. + * @since 2.4.0 + */ + inheritPortableObjectVerifier?: boolean; + } = {} + ): AsyncIterable { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if ( + options.verifyPortableObject == null && + this._verifyPortableObject != null + ) { + options = { + ...options, + verifyPortableObject: this._verifyPortableObject, + }; + } + const vs = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + for (let i = 0; i < vs.length; i++) { + let v = vs[i]; + if (!(v instanceof URL) && + !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { + if (v.id == null) { + if (isUnsecuredPortableObject(this)) { + warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#instrument\\"); + continue; + } + } else if ( + !isTrustedIriOrigin(options, v.id, this.id) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject(this, this.id, v.id, options) + ) { + v = v.id; + } + } + if (v instanceof URL) { + const fetched = + await this.#fetchInstrument(v, options); + if (fetched == null) continue; + // Not cached, so that it is verified when the portable object + // policy applies later: + if (isUnverifiedPortableClaim(fetched)) { + yield fetched; + continue; + } + vs[i] = fetched; + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); + this._cachedJsonLd = undefined; + recordPortableReferrer(this, fetched, \\"https://www.w3.org/ns/activitystreams#instrument\\"); + yield fetched; + continue; + } + + if ( + this._cachedJsonLd != null && + typeof this._cachedJsonLd === \\"object\\" && + \\"@context\\" in this._cachedJsonLd && + \\"instrument\\" in this._cachedJsonLd + ) { + const prop = this._cachedJsonLd[ + \\"instrument\\"]; + const obj = Array.isArray(prop) ? prop[i] : prop; + if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { + try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + context, + \\"instrument\\", + [\\"https://www.w3.org/ns/activitystreams#instrument\\"], + cachedContextLoader, + ) + ) { + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"instrument\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#instrument_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + this._baseUrl ?? + (this.id != null && + (this.id.protocol === \\"http:\\" || + this.id.protocol === \\"https:\\") + ? this.id + : undefined), + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -36497,34 +37012,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -36944,34 +37469,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -41584,34 +42119,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -42031,34 +42576,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -43974,34 +44529,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -44421,34 +44986,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -46363,34 +46938,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -46810,34 +47395,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -49390,207 +49985,20 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"translator\\", [\\"https://schema.org/translator\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#translator_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); - } - } catch (error) { - if (!options.suppressError) throw error; - getLogger([\\"fedify\\", \\"vocab\\"]).debug( - \\"Failed to parse embedded value of {property}: {error}\\", - { property: \\"https://schema.org/translator\\", error }, - ); - return null; - } - } - } - - if (v?.id != null && - ((!isTrustedIriOrigin(options, v.id, null)) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject( - this, null, v.id, options, - )) && - !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { - if (options.crossOrigin === \\"throw\\") { - throw new Error( - \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + - \\"origin than the property owner's @id (\\" + \\"untrusted metadata\\" + \\"); \\" + - \\"refusing to return the object. If you want to bypass this \\" + - \\"check and are aware of the security implications, set the \\" + - 'crossOrigin option to \\"trust\\".' - ); - } - getLogger([\\"fedify\\", \\"vocab\\"]).warn( - \\"The property object's @id ({objectId}) has a different origin \\" + - \\"than the property owner's @id ({parentObjectId}); refusing to \\" + - \\"return the object. If you want to bypass this check and are \\" + - \\"aware of the security implications, set the crossOrigin option \\" + - 'to \\"trust\\".', - { objectId: v.id.href, parentObjectId: \\"untrusted metadata\\" }, - ); - return null; - } - recordPortableReferrer(this, v, \\"https://schema.org/translator\\"); - return v; - } - - /** - * Similar to - * {@link Translation.getTranslators}, - * but returns their \`@id\`s instead of the objects themselves. - */ - get translatorIds(): URL[] { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - return this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.map((v) => - v instanceof URL ? v : v.id! - ).filter(id => id !== null); - } - -/** The actors credited for this language version. Their order has no - * meaning. Human actors credit translation or review; Application and - * Service actors credit machine output. If any actor cannot be resolved, - * the entry's human-or-machine status is unknown. Credit is asserted by - * the publisher and grants no publishing authority. Embedded actors with - * identifiers are fetched before being returned unless explicitly trusted. - * - */ - - async* getTranslators( - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - suppressError?: boolean, - tracerProvider?: TracerProvider, - crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\"; - gateways?: readonly (string | URL)[]; - verifyPortableObject?: PortableObjectVerifier; - /** - * Whether objects that this call newly fetches use the - * \`verifyPortableObject\` option of this call as their default - * verifier. Defaults to \`true\`. If \`false\`, the option - * applies to this call only, and fetched objects use this object's - * own default verifier, if any, as their default instead. Pass - * \`false\` for a temporary verifier, e.g., one that accepts - * everything. Objects that were already cached in this object or - * embedded in it keep their defaults either way, and this option - * itself is not passed on. - * @since 2.4.0 - */ - inheritPortableObjectVerifier?: boolean; - } = {} - ): AsyncIterable { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - if ( - options.verifyPortableObject == null && - this._verifyPortableObject != null - ) { - options = { - ...options, - verifyPortableObject: this._verifyPortableObject, - }; - } - const vs = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; - for (let i = 0; i < vs.length; i++) { - let v = vs[i]; - if (!(v instanceof URL) && - !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { - if (v.id == null) { - if (isUnsecuredPortableObject(this)) { - warnUnverifiableEmbeddedObject(this, \\"https://schema.org/translator\\"); - continue; - } - } else if ( - !isTrustedIriOrigin(options, v.id, null) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject(this, null, v.id, options) - ) { - v = v.id; - } - } - if (v instanceof URL) { - const fetched = - await this.#fetchTranslator(v, options); - if (fetched == null) continue; - // Not cached, so that it is verified when the portable object - // policy applies later: - if (isUnverifiedPortableClaim(fetched)) { - yield fetched; - continue; - } - vs[i] = fetched; - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); - this._cachedJsonLd = undefined; - recordPortableReferrer(this, fetched, \\"https://schema.org/translator\\"); - yield fetched; - continue; - } - - if ( - this._cachedJsonLd != null && - typeof this._cachedJsonLd === \\"object\\" && - \\"@context\\" in this._cachedJsonLd && - \\"translator\\" in this._cachedJsonLd - ) { - const prop = this._cachedJsonLd[ - \\"translator\\"]; - const obj = Array.isArray(prop) ? prop[i] : prop; - if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); - const context = getCachedJsonLdContext( - this, - this._cachedJsonLd[\\"@context\\"], - ); if ( - await isCachedPropertyKey( - this._cachedJsonLd as Record, + canDecodeCachedJsonLd( + this, context, - obj, + doc, \\"translator\\", - [\\"https://schema.org/translator\\"], - cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); + const inherited = inheritJsonLdContext(context, doc); v = await this.#translator_fromJsonLd( inherited, { @@ -49608,10 +50016,217 @@ rawPropertyDescriptors.set(this.prototype, descriptors); ); await keepCachedJsonLd( v as object, - obj, + doc, inherited, cachedContextLoader, ); + } else { + fixCachedJsonLd(v, doc); + } + } + } catch (error) { + if (!options.suppressError) throw error; + getLogger([\\"fedify\\", \\"vocab\\"]).debug( + \\"Failed to parse embedded value of {property}: {error}\\", + { property: \\"https://schema.org/translator\\", error }, + ); + return null; + } + } + } + + if (v?.id != null && + ((!isTrustedIriOrigin(options, v.id, null)) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject( + this, null, v.id, options, + )) && + !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { + if (options.crossOrigin === \\"throw\\") { + throw new Error( + \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + + \\"origin than the property owner's @id (\\" + \\"untrusted metadata\\" + \\"); \\" + + \\"refusing to return the object. If you want to bypass this \\" + + \\"check and are aware of the security implications, set the \\" + + 'crossOrigin option to \\"trust\\".' + ); + } + getLogger([\\"fedify\\", \\"vocab\\"]).warn( + \\"The property object's @id ({objectId}) has a different origin \\" + + \\"than the property owner's @id ({parentObjectId}); refusing to \\" + + \\"return the object. If you want to bypass this check and are \\" + + \\"aware of the security implications, set the crossOrigin option \\" + + 'to \\"trust\\".', + { objectId: v.id.href, parentObjectId: \\"untrusted metadata\\" }, + ); + return null; + } + recordPortableReferrer(this, v, \\"https://schema.org/translator\\"); + return v; + } + + /** + * Similar to + * {@link Translation.getTranslators}, + * but returns their \`@id\`s instead of the objects themselves. + */ + get translatorIds(): URL[] { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + return this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.map((v) => + v instanceof URL ? v : v.id! + ).filter(id => id !== null); + } + +/** The actors credited for this language version. Their order has no + * meaning. Human actors credit translation or review; Application and + * Service actors credit machine output. If any actor cannot be resolved, + * the entry's human-or-machine status is unknown. Credit is asserted by + * the publisher and grants no publishing authority. Embedded actors with + * identifiers are fetched before being returned unless explicitly trusted. + * + */ + + async* getTranslators( + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + suppressError?: boolean, + tracerProvider?: TracerProvider, + crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\"; + gateways?: readonly (string | URL)[]; + verifyPortableObject?: PortableObjectVerifier; + /** + * Whether objects that this call newly fetches use the + * \`verifyPortableObject\` option of this call as their default + * verifier. Defaults to \`true\`. If \`false\`, the option + * applies to this call only, and fetched objects use this object's + * own default verifier, if any, as their default instead. Pass + * \`false\` for a temporary verifier, e.g., one that accepts + * everything. Objects that were already cached in this object or + * embedded in it keep their defaults either way, and this option + * itself is not passed on. + * @since 2.4.0 + */ + inheritPortableObjectVerifier?: boolean; + } = {} + ): AsyncIterable { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if ( + options.verifyPortableObject == null && + this._verifyPortableObject != null + ) { + options = { + ...options, + verifyPortableObject: this._verifyPortableObject, + }; + } + const vs = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; + for (let i = 0; i < vs.length; i++) { + let v = vs[i]; + if (!(v instanceof URL) && + !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { + if (v.id == null) { + if (isUnsecuredPortableObject(this)) { + warnUnverifiableEmbeddedObject(this, \\"https://schema.org/translator\\"); + continue; + } + } else if ( + !isTrustedIriOrigin(options, v.id, null) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject(this, null, v.id, options) + ) { + v = v.id; + } + } + if (v instanceof URL) { + const fetched = + await this.#fetchTranslator(v, options); + if (fetched == null) continue; + // Not cached, so that it is verified when the portable object + // policy applies later: + if (isUnverifiedPortableClaim(fetched)) { + yield fetched; + continue; + } + vs[i] = fetched; + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); + this._cachedJsonLd = undefined; + recordPortableReferrer(this, fetched, \\"https://schema.org/translator\\"); + yield fetched; + continue; + } + + if ( + this._cachedJsonLd != null && + typeof this._cachedJsonLd === \\"object\\" && + \\"@context\\" in this._cachedJsonLd && + \\"translator\\" in this._cachedJsonLd + ) { + const prop = this._cachedJsonLd[ + \\"translator\\"]; + const obj = Array.isArray(prop) ? prop[i] : prop; + if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { + try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + context, + \\"translator\\", + [\\"https://schema.org/translator\\"], + cachedContextLoader, + ) + ) { + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"translator\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#translator_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + this._baseUrl ?? + (this.id != null && + (this.id.protocol === \\"http:\\" || + this.id.protocol === \\"https:\\") + ? this.id + : undefined), + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -51459,34 +52074,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -51905,34 +52530,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -54836,34 +55471,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"current\\", [\\"https://www.w3.org/ns/activitystreams#current\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#current_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"current\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#current_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -55284,34 +55929,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"first\\", [\\"https://www.w3.org/ns/activitystreams#first\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#first_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"first\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#first_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -55732,34 +56387,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"last\\", [\\"https://www.w3.org/ns/activitystreams#last\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#last_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"last\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#last_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -56199,34 +56864,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"items\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"items\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#item_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -56647,34 +57322,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"likesOf\\", [\\"https://w3id.org/fep/5711#likesOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likesOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"likesOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likesOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -57094,34 +57779,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"sharesOf\\", [\\"https://w3id.org/fep/5711#sharesOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#sharesOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"sharesOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#sharesOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -57541,34 +58236,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"repliesOf\\", [\\"https://w3id.org/fep/5711#repliesOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#repliesOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"repliesOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#repliesOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -57988,34 +58693,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inboxOf\\", [\\"https://w3id.org/fep/5711#inboxOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inboxOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inboxOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inboxOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -58435,34 +59150,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outboxOf\\", [\\"https://w3id.org/fep/5711#outboxOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outboxOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outboxOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outboxOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -58882,34 +59607,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followersOf\\", [\\"https://w3id.org/fep/5711#followersOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followersOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followersOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followersOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -59329,34 +60064,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followingOf\\", [\\"https://w3id.org/fep/5711#followingOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followingOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followingOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followingOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -59776,34 +60521,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"likedOf\\", [\\"https://w3id.org/fep/5711#likedOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likedOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"likedOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likedOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -62399,34 +63154,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"orderedItems\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#item_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -64611,34 +65376,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredObject\\", [\\"https://w3id.org/fep/7aa9#featuredObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -65059,34 +65834,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featureAuthorization\\", [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featureAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featureAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featureAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -69695,34 +70480,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"owner\\", [\\"https://w3id.org/security#owner\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#owner_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"owner\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#owner_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -71262,34 +72057,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"controller\\", [\\"https://w3id.org/security#controller\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#controller_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"controller\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#controller_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -81613,34 +82418,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -81801,34 +82616,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -82252,34 +83077,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -82444,34 +83279,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -82965,34 +83810,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -83436,34 +84291,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -83887,34 +84752,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -84341,34 +85216,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -84793,34 +85678,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -85243,34 +86138,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -85693,34 +86598,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -86140,34 +87055,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -86591,34 +87516,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -87184,34 +88119,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -87694,34 +88639,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -87886,34 +88841,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -88337,34 +89302,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -88529,34 +89504,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -93757,34 +94742,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quote\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -94228,34 +95223,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quoteAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -98471,34 +99476,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"partOf\\", [\\"https://www.w3.org/ns/activitystreams#partOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#partOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"partOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#partOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -98917,34 +99932,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"next\\", [\\"https://www.w3.org/ns/activitystreams#next\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#next_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"next\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#next_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -99364,34 +100389,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"prev\\", [\\"https://www.w3.org/ns/activitystreams#prev\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#prev_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"prev\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#prev_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -108499,34 +109534,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -108687,34 +109732,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -109138,34 +110193,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -109330,34 +110395,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -109851,34 +110926,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -110322,34 +111407,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -110773,34 +111868,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -111227,34 +112332,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -111679,34 +112794,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -112129,34 +113254,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -112579,34 +113714,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -113026,34 +114171,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -113477,34 +114632,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -114070,34 +115235,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -114580,34 +115755,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -114772,34 +115957,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -115223,34 +116418,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -115415,34 +116620,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -120499,34 +121714,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"preview\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#preview_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -127974,34 +129199,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quote\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -128445,34 +129680,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quoteAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -130000,34 +131245,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"orderedItems\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#item_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -133940,34 +135195,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -134128,34 +135393,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -134579,34 +135854,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -134771,34 +136056,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -135292,34 +136587,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -135763,34 +137068,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -136214,34 +137529,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -136668,34 +137993,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -137120,34 +138455,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -137570,34 +138915,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -138020,34 +139375,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -138467,34 +139832,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -138918,34 +140293,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -139511,34 +140896,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140021,34 +141416,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140213,34 +141618,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140664,34 +142079,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140856,34 +142281,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -147989,34 +149424,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -148177,34 +149622,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -148628,34 +150083,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -148820,34 +150285,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -149341,34 +150816,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -149812,34 +151297,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -150263,34 +151758,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -150717,34 +152222,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -151169,34 +152684,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -151619,34 +153144,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -152069,34 +153604,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -152516,34 +154061,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -152967,34 +154522,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -153560,34 +155125,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154070,34 +155645,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154262,34 +155847,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154713,34 +156308,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154905,34 +156510,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -160429,34 +162044,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"describes\\", [\\"https://www.w3.org/ns/activitystreams#describes\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#describes_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"describes\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#describes_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -162219,34 +163844,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"oneOf\\", [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#exclusiveOption_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"oneOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#exclusiveOption_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -162673,34 +164308,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"anyOf\\", [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#inclusiveOption_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"anyOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#inclusiveOption_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -163153,34 +164798,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quote\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -163624,34 +165279,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quoteAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -166756,34 +168421,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"subject\\", [\\"https://www.w3.org/ns/activitystreams#subject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#subject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"subject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#subject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -167203,34 +168878,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"object\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -167392,34 +169077,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"object\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -167842,34 +169537,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"relationship\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#relationship_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -168033,34 +169738,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"relationship\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#relationship_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -172620,34 +174335,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -172808,34 +174533,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -173259,34 +174994,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -173451,34 +175196,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -173972,34 +175727,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -174443,34 +176208,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -174894,34 +176669,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -175348,34 +177133,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -175800,34 +177595,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -176250,34 +178055,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -176700,34 +178515,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -177147,34 +178972,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -177598,34 +179433,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -178191,34 +180036,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -178701,34 +180556,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -178893,34 +180758,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -179344,34 +181219,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -179536,34 +181421,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index a32fce64c..e5e536156 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -538,6 +538,42 @@ function isNonPropagatingContext(context: unknown): boolean { (first as Record)[\\"@propagate\\"] === false; } +// Objects whose contexts could not be rebuilt, so that neither they nor the +// objects nested in them can be decoded again from their cached JSON-LD: +const fixedCachedJsonLd = new WeakSet(); + +// Whether an embedded document under a key of the cached JSON-LD of an object +// can be decoded again. Prepending a context cannot rebuild what a context +// that does not propagate to embedded nodes, in the document or in the embedded +// document, or a property-scoped context for the key took part in: +function canDecodeCachedJsonLd( + object: object, + context: unknown, + embedded: object, + key: string, +): boolean { + return !fixedCachedJsonLd.has(object) && + !isNonPropagatingContext(context) && + !isNonPropagatingContext( + (embedded as { \\"@context\\"?: unknown })[\\"@context\\"], + ) && + !hasPropertyScopedContext(context, key); +} + +// Gives an object decoded with the whole document the document it was received +// as, which a proof can cover, when it cannot be decoded from that document: +function fixCachedJsonLd(object: unknown, document: object): void { + if ( + object == null || typeof object !== \\"object\\" || + !(RAW_PROPERTY_PROTOCOL in object) + ) { + return; + } + (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = + structuredClone(document); + fixedCachedJsonLd.add(object); +} + function hasPropertyScopedContext(context: unknown, key: string): boolean { const entries = globalThis.Array.isArray(context) ? context : [context]; return entries.some((entry) => { @@ -548,29 +584,18 @@ function hasPropertyScopedContext(context: unknown, key: string): boolean { }); } -// Whether the embedded documents under a key of a compacted document can be -// decoded again in place of the values decoded for a property. The document -// has to map the key, and no other key, to the property, as a context can -// remap the key or map another term to the property, in which case the cached -// documents cannot be matched with the decoded values. An inline context -// that does not propagate to embedded nodes, in the document or in the -// embedded document, and a property-scoped context for the key rule it out as -// well, since prepending a context cannot rebuild what they were decoded with: +// Whether the embedded documents under a key of a compacted document are the +// values decoded for a property. The document has to map the key, and no other +// key, to the property, as a context can remap the key or map another term to +// the property, in which case the cached documents cannot be matched with the +// decoded values: async function isCachedPropertyKey( document: Record, context: unknown, - embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { - if ( - isNonPropagatingContext(context) || - isNonPropagatingContext((embedded as { \\"@context\\"?: unknown })[\\"@context\\"]) || - hasPropertyScopedContext(context, key) - ) { - return false; - } let checks = cachedPropertyKeys.get(document); if (checks == null) { checks = new Map(); @@ -6512,34 +6537,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"attachment\\", [\\"https://www.w3.org/ns/activitystreams#attachment\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attachment_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"attachment\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#attachment_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7022,34 +7057,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"attributedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#attribution_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7213,34 +7258,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"attributedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#attribution_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7662,34 +7717,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"audience\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#audience_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7852,34 +7917,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"audience\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#audience_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -8354,34 +8429,44 @@ get contents(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"context\\", [\\"https://www.w3.org/ns/activitystreams#context\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#context_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"context\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#context_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -8863,34 +8948,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"generator\\", [\\"https://www.w3.org/ns/activitystreams#generator\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#generator_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"generator\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#generator_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -9335,34 +9430,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"icon\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#icon_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -9526,34 +9631,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"icon\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#icon_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -9998,34 +10113,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"image\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#image_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10189,34 +10314,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"image\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#image_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10653,34 +10788,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inReplyTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#replyTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10843,34 +10988,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"inReplyTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#replyTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -11307,34 +11462,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"location\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#location_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -11497,34 +11662,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"location\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#location_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -11960,34 +12135,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"preview\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#preview_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -12149,34 +12334,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"preview\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#preview_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -12611,34 +12806,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"replies\\", [\\"https://www.w3.org/ns/activitystreams#replies\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replies_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"replies\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#replies_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -13065,34 +13270,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"shares\\", [\\"https://www.w3.org/ns/activitystreams#shares\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#shares_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"shares\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#shares_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -13519,34 +13734,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"likes\\", [\\"https://www.w3.org/ns/activitystreams#likes\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likes_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"likes\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likes_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -13967,34 +14192,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"emojiReactions\\", [\\"http://fedibird.com/ns#emojiReactions\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#emojiReactions_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"emojiReactions\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#emojiReactions_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -14476,34 +14711,44 @@ get summaries(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"tag\\", [\\"https://www.w3.org/ns/activitystreams#tag\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#tag_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"tag\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#tag_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -14959,34 +15204,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"to\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#to_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -15149,34 +15404,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"to\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#to_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -15598,34 +15863,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"bto\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#bto_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -15788,34 +16063,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"bto\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#bto_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -16237,34 +16522,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"cc\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#cc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -16427,34 +16722,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"cc\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#cc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -16876,34 +17181,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"bcc\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#bcc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -17066,34 +17381,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"bcc\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#bcc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -17578,34 +17903,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"proof\\", [\\"https://w3id.org/security#proof\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"proof\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#proof_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -17767,34 +18102,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"proof\\", [\\"https://w3id.org/security#proof\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"proof\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#proof_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -18255,34 +18600,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"likeAuthorization\\", [\\"https://gotosocial.org/ns#likeAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likeAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"likeAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likeAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -18703,34 +19058,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"replyAuthorization\\", [\\"https://gotosocial.org/ns#replyAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"replyAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#replyAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -19151,34 +19516,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"announceAuthorization\\", [\\"https://gotosocial.org/ns#announceAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#announceAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"announceAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#announceAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -25726,34 +26101,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quote\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -26197,34 +26582,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quoteAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -28736,34 +29131,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"actor\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#actor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -28927,34 +29332,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"actor\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#actor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -29377,34 +29792,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"object\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -29568,34 +29993,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"object\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30021,34 +30456,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"target\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#target_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30215,34 +30660,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"target\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#target_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30665,34 +31120,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"result\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#result_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30856,34 +31321,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"result\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#result_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -31307,34 +31782,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"origin\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#origin_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -31499,34 +31984,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"origin\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#origin_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -31948,203 +32443,20 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#instrument_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); - } - } catch (error) { - if (!options.suppressError) throw error; - getLogger([\\"fedify\\", \\"vocab\\"]).debug( - \\"Failed to parse embedded value of {property}: {error}\\", - { property: \\"https://www.w3.org/ns/activitystreams#instrument\\", error }, - ); - return null; - } - } - } - - if (v?.id != null && - ((this.id != null && !isTrustedIriOrigin(options, v.id, this.id)) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject( - this, this.id, v.id, options, - )) && - !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { - if (options.crossOrigin === \\"throw\\") { - throw new Error( - \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + - \\"origin than the property owner's @id (\\" + (this.id?.href ?? null) + \\"); \\" + - \\"refusing to return the object. If you want to bypass this \\" + - \\"check and are aware of the security implications, set the \\" + - 'crossOrigin option to \\"trust\\".' - ); - } - getLogger([\\"fedify\\", \\"vocab\\"]).warn( - \\"The property object's @id ({objectId}) has a different origin \\" + - \\"than the property owner's @id ({parentObjectId}); refusing to \\" + - \\"return the object. If you want to bypass this check and are \\" + - \\"aware of the security implications, set the crossOrigin option \\" + - 'to \\"trust\\".', - { objectId: v.id.href, parentObjectId: (this.id?.href ?? null) }, - ); - return null; - } - recordPortableReferrer(this, v, \\"https://www.w3.org/ns/activitystreams#instrument\\"); - return v; - } - - /** - * Similar to - * {@link Activity.getInstruments}, - * but returns their \`@id\`s instead of the objects themselves. - */ - get instrumentIds(): URL[] { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - return this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.map((v) => - v instanceof URL ? v : v.id! - ).filter(id => id !== null); - } - -/** Identifies one or more objects used (or to be used) in the completion of - * an {@link Activity}. - * - */ - - async* getInstruments( - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - suppressError?: boolean, - tracerProvider?: TracerProvider, - crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\"; - gateways?: readonly (string | URL)[]; - verifyPortableObject?: PortableObjectVerifier; - /** - * Whether objects that this call newly fetches use the - * \`verifyPortableObject\` option of this call as their default - * verifier. Defaults to \`true\`. If \`false\`, the option - * applies to this call only, and fetched objects use this object's - * own default verifier, if any, as their default instead. Pass - * \`false\` for a temporary verifier, e.g., one that accepts - * everything. Objects that were already cached in this object or - * embedded in it keep their defaults either way, and this option - * itself is not passed on. - * @since 2.4.0 - */ - inheritPortableObjectVerifier?: boolean; - } = {} - ): AsyncIterable { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - if ( - options.verifyPortableObject == null && - this._verifyPortableObject != null - ) { - options = { - ...options, - verifyPortableObject: this._verifyPortableObject, - }; - } - const vs = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; - for (let i = 0; i < vs.length; i++) { - let v = vs[i]; - if (!(v instanceof URL) && - !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { - if (v.id == null) { - if (isUnsecuredPortableObject(this)) { - warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#instrument\\"); - continue; - } - } else if ( - !isTrustedIriOrigin(options, v.id, this.id) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject(this, this.id, v.id, options) - ) { - v = v.id; - } - } - if (v instanceof URL) { - const fetched = - await this.#fetchInstrument(v, options); - if (fetched == null) continue; - // Not cached, so that it is verified when the portable object - // policy applies later: - if (isUnverifiedPortableClaim(fetched)) { - yield fetched; - continue; - } - vs[i] = fetched; - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); - this._cachedJsonLd = undefined; - recordPortableReferrer(this, fetched, \\"https://www.w3.org/ns/activitystreams#instrument\\"); - yield fetched; - continue; - } - - if ( - this._cachedJsonLd != null && - typeof this._cachedJsonLd === \\"object\\" && - \\"@context\\" in this._cachedJsonLd && - \\"instrument\\" in this._cachedJsonLd - ) { - const prop = this._cachedJsonLd[ - \\"instrument\\"]; - const obj = Array.isArray(prop) ? prop[i] : prop; - if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); - const context = getCachedJsonLdContext( - this, - this._cachedJsonLd[\\"@context\\"], - ); if ( - await isCachedPropertyKey( - this._cachedJsonLd as Record, + canDecodeCachedJsonLd( + this, context, - obj, + doc, \\"instrument\\", - [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); + const inherited = inheritJsonLdContext(context, doc); v = await this.#instrument_fromJsonLd( inherited, { @@ -32162,10 +32474,213 @@ rawPropertyDescriptors.set(this.prototype, descriptors); ); await keepCachedJsonLd( v as object, - obj, + doc, inherited, cachedContextLoader, ); + } else { + fixCachedJsonLd(v, doc); + } + } + } catch (error) { + if (!options.suppressError) throw error; + getLogger([\\"fedify\\", \\"vocab\\"]).debug( + \\"Failed to parse embedded value of {property}: {error}\\", + { property: \\"https://www.w3.org/ns/activitystreams#instrument\\", error }, + ); + return null; + } + } + } + + if (v?.id != null && + ((this.id != null && !isTrustedIriOrigin(options, v.id, this.id)) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject( + this, this.id, v.id, options, + )) && + !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { + if (options.crossOrigin === \\"throw\\") { + throw new Error( + \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + + \\"origin than the property owner's @id (\\" + (this.id?.href ?? null) + \\"); \\" + + \\"refusing to return the object. If you want to bypass this \\" + + \\"check and are aware of the security implications, set the \\" + + 'crossOrigin option to \\"trust\\".' + ); + } + getLogger([\\"fedify\\", \\"vocab\\"]).warn( + \\"The property object's @id ({objectId}) has a different origin \\" + + \\"than the property owner's @id ({parentObjectId}); refusing to \\" + + \\"return the object. If you want to bypass this check and are \\" + + \\"aware of the security implications, set the crossOrigin option \\" + + 'to \\"trust\\".', + { objectId: v.id.href, parentObjectId: (this.id?.href ?? null) }, + ); + return null; + } + recordPortableReferrer(this, v, \\"https://www.w3.org/ns/activitystreams#instrument\\"); + return v; + } + + /** + * Similar to + * {@link Activity.getInstruments}, + * but returns their \`@id\`s instead of the objects themselves. + */ + get instrumentIds(): URL[] { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + return this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.map((v) => + v instanceof URL ? v : v.id! + ).filter(id => id !== null); + } + +/** Identifies one or more objects used (or to be used) in the completion of + * an {@link Activity}. + * + */ + + async* getInstruments( + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + suppressError?: boolean, + tracerProvider?: TracerProvider, + crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\"; + gateways?: readonly (string | URL)[]; + verifyPortableObject?: PortableObjectVerifier; + /** + * Whether objects that this call newly fetches use the + * \`verifyPortableObject\` option of this call as their default + * verifier. Defaults to \`true\`. If \`false\`, the option + * applies to this call only, and fetched objects use this object's + * own default verifier, if any, as their default instead. Pass + * \`false\` for a temporary verifier, e.g., one that accepts + * everything. Objects that were already cached in this object or + * embedded in it keep their defaults either way, and this option + * itself is not passed on. + * @since 2.4.0 + */ + inheritPortableObjectVerifier?: boolean; + } = {} + ): AsyncIterable { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if ( + options.verifyPortableObject == null && + this._verifyPortableObject != null + ) { + options = { + ...options, + verifyPortableObject: this._verifyPortableObject, + }; + } + const vs = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + for (let i = 0; i < vs.length; i++) { + let v = vs[i]; + if (!(v instanceof URL) && + !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { + if (v.id == null) { + if (isUnsecuredPortableObject(this)) { + warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#instrument\\"); + continue; + } + } else if ( + !isTrustedIriOrigin(options, v.id, this.id) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject(this, this.id, v.id, options) + ) { + v = v.id; + } + } + if (v instanceof URL) { + const fetched = + await this.#fetchInstrument(v, options); + if (fetched == null) continue; + // Not cached, so that it is verified when the portable object + // policy applies later: + if (isUnverifiedPortableClaim(fetched)) { + yield fetched; + continue; + } + vs[i] = fetched; + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); + this._cachedJsonLd = undefined; + recordPortableReferrer(this, fetched, \\"https://www.w3.org/ns/activitystreams#instrument\\"); + yield fetched; + continue; + } + + if ( + this._cachedJsonLd != null && + typeof this._cachedJsonLd === \\"object\\" && + \\"@context\\" in this._cachedJsonLd && + \\"instrument\\" in this._cachedJsonLd + ) { + const prop = this._cachedJsonLd[ + \\"instrument\\"]; + const obj = Array.isArray(prop) ? prop[i] : prop; + if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { + try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + context, + \\"instrument\\", + [\\"https://www.w3.org/ns/activitystreams#instrument\\"], + cachedContextLoader, + ) + ) { + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"instrument\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#instrument_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + this._baseUrl ?? + (this.id != null && + (this.id.protocol === \\"http:\\" || + this.id.protocol === \\"https:\\") + ? this.id + : undefined), + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -36495,34 +37010,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -36942,34 +37467,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -41582,34 +42117,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -42029,34 +42574,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -43972,34 +44527,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -44419,34 +44984,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -46361,34 +46936,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -46808,34 +47393,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -49388,207 +49983,20 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"translator\\", [\\"https://schema.org/translator\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#translator_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); - } - } catch (error) { - if (!options.suppressError) throw error; - getLogger([\\"fedify\\", \\"vocab\\"]).debug( - \\"Failed to parse embedded value of {property}: {error}\\", - { property: \\"https://schema.org/translator\\", error }, - ); - return null; - } - } - } - - if (v?.id != null && - ((!isTrustedIriOrigin(options, v.id, null)) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject( - this, null, v.id, options, - )) && - !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { - if (options.crossOrigin === \\"throw\\") { - throw new Error( - \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + - \\"origin than the property owner's @id (\\" + \\"untrusted metadata\\" + \\"); \\" + - \\"refusing to return the object. If you want to bypass this \\" + - \\"check and are aware of the security implications, set the \\" + - 'crossOrigin option to \\"trust\\".' - ); - } - getLogger([\\"fedify\\", \\"vocab\\"]).warn( - \\"The property object's @id ({objectId}) has a different origin \\" + - \\"than the property owner's @id ({parentObjectId}); refusing to \\" + - \\"return the object. If you want to bypass this check and are \\" + - \\"aware of the security implications, set the crossOrigin option \\" + - 'to \\"trust\\".', - { objectId: v.id.href, parentObjectId: \\"untrusted metadata\\" }, - ); - return null; - } - recordPortableReferrer(this, v, \\"https://schema.org/translator\\"); - return v; - } - - /** - * Similar to - * {@link Translation.getTranslators}, - * but returns their \`@id\`s instead of the objects themselves. - */ - get translatorIds(): URL[] { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - return this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.map((v) => - v instanceof URL ? v : v.id! - ).filter(id => id !== null); - } - -/** The actors credited for this language version. Their order has no - * meaning. Human actors credit translation or review; Application and - * Service actors credit machine output. If any actor cannot be resolved, - * the entry's human-or-machine status is unknown. Credit is asserted by - * the publisher and grants no publishing authority. Embedded actors with - * identifiers are fetched before being returned unless explicitly trusted. - * - */ - - async* getTranslators( - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - suppressError?: boolean, - tracerProvider?: TracerProvider, - crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\"; - gateways?: readonly (string | URL)[]; - verifyPortableObject?: PortableObjectVerifier; - /** - * Whether objects that this call newly fetches use the - * \`verifyPortableObject\` option of this call as their default - * verifier. Defaults to \`true\`. If \`false\`, the option - * applies to this call only, and fetched objects use this object's - * own default verifier, if any, as their default instead. Pass - * \`false\` for a temporary verifier, e.g., one that accepts - * everything. Objects that were already cached in this object or - * embedded in it keep their defaults either way, and this option - * itself is not passed on. - * @since 2.4.0 - */ - inheritPortableObjectVerifier?: boolean; - } = {} - ): AsyncIterable { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - if ( - options.verifyPortableObject == null && - this._verifyPortableObject != null - ) { - options = { - ...options, - verifyPortableObject: this._verifyPortableObject, - }; - } - const vs = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; - for (let i = 0; i < vs.length; i++) { - let v = vs[i]; - if (!(v instanceof URL) && - !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { - if (v.id == null) { - if (isUnsecuredPortableObject(this)) { - warnUnverifiableEmbeddedObject(this, \\"https://schema.org/translator\\"); - continue; - } - } else if ( - !isTrustedIriOrigin(options, v.id, null) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject(this, null, v.id, options) - ) { - v = v.id; - } - } - if (v instanceof URL) { - const fetched = - await this.#fetchTranslator(v, options); - if (fetched == null) continue; - // Not cached, so that it is verified when the portable object - // policy applies later: - if (isUnverifiedPortableClaim(fetched)) { - yield fetched; - continue; - } - vs[i] = fetched; - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); - this._cachedJsonLd = undefined; - recordPortableReferrer(this, fetched, \\"https://schema.org/translator\\"); - yield fetched; - continue; - } - - if ( - this._cachedJsonLd != null && - typeof this._cachedJsonLd === \\"object\\" && - \\"@context\\" in this._cachedJsonLd && - \\"translator\\" in this._cachedJsonLd - ) { - const prop = this._cachedJsonLd[ - \\"translator\\"]; - const obj = Array.isArray(prop) ? prop[i] : prop; - if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); - const context = getCachedJsonLdContext( - this, - this._cachedJsonLd[\\"@context\\"], - ); if ( - await isCachedPropertyKey( - this._cachedJsonLd as Record, + canDecodeCachedJsonLd( + this, context, - obj, + doc, \\"translator\\", - [\\"https://schema.org/translator\\"], - cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); + const inherited = inheritJsonLdContext(context, doc); v = await this.#translator_fromJsonLd( inherited, { @@ -49606,10 +50014,217 @@ rawPropertyDescriptors.set(this.prototype, descriptors); ); await keepCachedJsonLd( v as object, - obj, + doc, inherited, cachedContextLoader, ); + } else { + fixCachedJsonLd(v, doc); + } + } + } catch (error) { + if (!options.suppressError) throw error; + getLogger([\\"fedify\\", \\"vocab\\"]).debug( + \\"Failed to parse embedded value of {property}: {error}\\", + { property: \\"https://schema.org/translator\\", error }, + ); + return null; + } + } + } + + if (v?.id != null && + ((!isTrustedIriOrigin(options, v.id, null)) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject( + this, null, v.id, options, + )) && + !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { + if (options.crossOrigin === \\"throw\\") { + throw new Error( + \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + + \\"origin than the property owner's @id (\\" + \\"untrusted metadata\\" + \\"); \\" + + \\"refusing to return the object. If you want to bypass this \\" + + \\"check and are aware of the security implications, set the \\" + + 'crossOrigin option to \\"trust\\".' + ); + } + getLogger([\\"fedify\\", \\"vocab\\"]).warn( + \\"The property object's @id ({objectId}) has a different origin \\" + + \\"than the property owner's @id ({parentObjectId}); refusing to \\" + + \\"return the object. If you want to bypass this check and are \\" + + \\"aware of the security implications, set the crossOrigin option \\" + + 'to \\"trust\\".', + { objectId: v.id.href, parentObjectId: \\"untrusted metadata\\" }, + ); + return null; + } + recordPortableReferrer(this, v, \\"https://schema.org/translator\\"); + return v; + } + + /** + * Similar to + * {@link Translation.getTranslators}, + * but returns their \`@id\`s instead of the objects themselves. + */ + get translatorIds(): URL[] { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + return this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.map((v) => + v instanceof URL ? v : v.id! + ).filter(id => id !== null); + } + +/** The actors credited for this language version. Their order has no + * meaning. Human actors credit translation or review; Application and + * Service actors credit machine output. If any actor cannot be resolved, + * the entry's human-or-machine status is unknown. Credit is asserted by + * the publisher and grants no publishing authority. Embedded actors with + * identifiers are fetched before being returned unless explicitly trusted. + * + */ + + async* getTranslators( + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + suppressError?: boolean, + tracerProvider?: TracerProvider, + crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\"; + gateways?: readonly (string | URL)[]; + verifyPortableObject?: PortableObjectVerifier; + /** + * Whether objects that this call newly fetches use the + * \`verifyPortableObject\` option of this call as their default + * verifier. Defaults to \`true\`. If \`false\`, the option + * applies to this call only, and fetched objects use this object's + * own default verifier, if any, as their default instead. Pass + * \`false\` for a temporary verifier, e.g., one that accepts + * everything. Objects that were already cached in this object or + * embedded in it keep their defaults either way, and this option + * itself is not passed on. + * @since 2.4.0 + */ + inheritPortableObjectVerifier?: boolean; + } = {} + ): AsyncIterable { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if ( + options.verifyPortableObject == null && + this._verifyPortableObject != null + ) { + options = { + ...options, + verifyPortableObject: this._verifyPortableObject, + }; + } + const vs = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; + for (let i = 0; i < vs.length; i++) { + let v = vs[i]; + if (!(v instanceof URL) && + !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { + if (v.id == null) { + if (isUnsecuredPortableObject(this)) { + warnUnverifiableEmbeddedObject(this, \\"https://schema.org/translator\\"); + continue; + } + } else if ( + !isTrustedIriOrigin(options, v.id, null) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject(this, null, v.id, options) + ) { + v = v.id; + } + } + if (v instanceof URL) { + const fetched = + await this.#fetchTranslator(v, options); + if (fetched == null) continue; + // Not cached, so that it is verified when the portable object + // policy applies later: + if (isUnverifiedPortableClaim(fetched)) { + yield fetched; + continue; + } + vs[i] = fetched; + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); + this._cachedJsonLd = undefined; + recordPortableReferrer(this, fetched, \\"https://schema.org/translator\\"); + yield fetched; + continue; + } + + if ( + this._cachedJsonLd != null && + typeof this._cachedJsonLd === \\"object\\" && + \\"@context\\" in this._cachedJsonLd && + \\"translator\\" in this._cachedJsonLd + ) { + const prop = this._cachedJsonLd[ + \\"translator\\"]; + const obj = Array.isArray(prop) ? prop[i] : prop; + if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { + try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd[\\"@context\\"], + ); + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + context, + \\"translator\\", + [\\"https://schema.org/translator\\"], + cachedContextLoader, + ) + ) { + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"translator\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#translator_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + this._baseUrl ?? + (this.id != null && + (this.id.protocol === \\"http:\\" || + this.id.protocol === \\"https:\\") + ? this.id + : undefined), + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -51457,34 +52072,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactingObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -51903,34 +52528,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"interactionTarget\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -54834,34 +55469,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"current\\", [\\"https://www.w3.org/ns/activitystreams#current\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#current_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"current\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#current_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -55282,34 +55927,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"first\\", [\\"https://www.w3.org/ns/activitystreams#first\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#first_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"first\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#first_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -55730,34 +56385,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"last\\", [\\"https://www.w3.org/ns/activitystreams#last\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#last_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"last\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#last_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -56197,34 +56862,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"items\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"items\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#item_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -56645,34 +57320,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"likesOf\\", [\\"https://w3id.org/fep/5711#likesOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likesOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"likesOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likesOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -57092,34 +57777,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"sharesOf\\", [\\"https://w3id.org/fep/5711#sharesOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#sharesOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"sharesOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#sharesOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -57539,34 +58234,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"repliesOf\\", [\\"https://w3id.org/fep/5711#repliesOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#repliesOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"repliesOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#repliesOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -57986,34 +58691,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inboxOf\\", [\\"https://w3id.org/fep/5711#inboxOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inboxOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inboxOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inboxOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -58433,34 +59148,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outboxOf\\", [\\"https://w3id.org/fep/5711#outboxOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outboxOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outboxOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outboxOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -58880,34 +59605,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followersOf\\", [\\"https://w3id.org/fep/5711#followersOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followersOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followersOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followersOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -59327,34 +60062,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followingOf\\", [\\"https://w3id.org/fep/5711#followingOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followingOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followingOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followingOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -59774,34 +60519,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"likedOf\\", [\\"https://w3id.org/fep/5711#likedOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likedOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"likedOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likedOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -62397,34 +63152,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"orderedItems\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#item_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -64609,34 +65374,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredObject\\", [\\"https://w3id.org/fep/7aa9#featuredObject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredObject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -65057,34 +65832,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featureAuthorization\\", [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featureAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featureAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featureAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -69693,34 +70478,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"owner\\", [\\"https://w3id.org/security#owner\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#owner_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"owner\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#owner_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -71260,34 +72055,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"controller\\", [\\"https://w3id.org/security#controller\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#controller_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"controller\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#controller_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -81611,34 +82416,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -81799,34 +82614,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -82250,34 +83075,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -82442,34 +83277,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -82963,34 +83808,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -83434,34 +84289,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -83885,34 +84750,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -84339,34 +85214,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -84791,34 +85676,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -85241,34 +86136,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -85691,34 +86596,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -86138,34 +87053,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -86589,34 +87514,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -87182,34 +88117,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -87692,34 +88637,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -87884,34 +88839,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -88335,34 +89300,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -88527,34 +89502,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -93755,34 +94740,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quote\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -94226,34 +95221,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quoteAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -98469,34 +99474,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"partOf\\", [\\"https://www.w3.org/ns/activitystreams#partOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#partOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"partOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#partOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -98915,34 +99930,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"next\\", [\\"https://www.w3.org/ns/activitystreams#next\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#next_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"next\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#next_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -99362,34 +100387,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"prev\\", [\\"https://www.w3.org/ns/activitystreams#prev\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#prev_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"prev\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#prev_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -108497,34 +109532,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -108685,34 +109730,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -109136,34 +110191,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -109328,34 +110393,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -109849,34 +110924,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -110320,34 +111405,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -110771,34 +111866,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -111225,34 +112330,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -111677,34 +112792,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -112127,34 +113252,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -112577,34 +113712,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -113024,34 +114169,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -113475,34 +114630,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -114068,34 +115233,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -114578,34 +115753,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -114770,34 +115955,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -115221,34 +116416,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -115413,34 +116618,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -120497,34 +121712,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"preview\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#preview_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -127972,34 +129197,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quote\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -128443,34 +129678,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quoteAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -129998,34 +131243,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"orderedItems\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#item_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -133938,34 +135193,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -134126,34 +135391,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -134577,34 +135852,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -134769,34 +136054,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -135290,34 +136585,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -135761,34 +137066,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -136212,34 +137527,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -136666,34 +137991,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -137118,34 +138453,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -137568,34 +138913,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -138018,34 +139373,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -138465,34 +139830,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -138916,34 +140291,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -139509,34 +140894,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140019,34 +141414,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140211,34 +141616,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140662,34 +142077,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140854,34 +142279,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -147987,34 +149422,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -148175,34 +149620,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -148626,34 +150081,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -148818,34 +150283,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -149339,34 +150814,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -149810,34 +151295,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -150261,34 +151756,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -150715,34 +152220,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -151167,34 +152682,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -151617,34 +153142,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -152067,34 +153602,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -152514,34 +154059,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -152965,34 +154520,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -153558,34 +155123,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154068,34 +155643,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154260,34 +155845,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154711,34 +156306,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154903,34 +156508,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -160427,34 +162042,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"describes\\", [\\"https://www.w3.org/ns/activitystreams#describes\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#describes_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"describes\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#describes_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -162217,34 +163842,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"oneOf\\", [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#exclusiveOption_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"oneOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#exclusiveOption_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -162671,34 +164306,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"anyOf\\", [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#inclusiveOption_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"anyOf\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#inclusiveOption_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -163151,34 +164796,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quote\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -163622,34 +165277,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"quoteAuthorization\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -166754,34 +168419,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"subject\\", [\\"https://www.w3.org/ns/activitystreams#subject\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#subject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"subject\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#subject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -167201,34 +168876,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"object\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -167390,34 +169075,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"object\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -167840,34 +169535,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"relationship\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#relationship_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -168031,34 +169736,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"relationship\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#relationship_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -172618,34 +174333,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -172806,34 +174531,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"publicKey\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -173257,34 +174992,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -173449,34 +175194,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"assertionMethod\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -173970,34 +175725,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"inbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -174441,34 +176206,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"outbox\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -174892,34 +176667,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"following\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -175346,34 +177131,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"followers\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -175798,34 +177593,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"liked\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -176248,34 +178053,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featured\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -176698,34 +178513,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredTags\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -177145,34 +178970,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"featuredCollections\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -177596,34 +179431,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"streams\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -178189,34 +180034,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"movedTo\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -178699,34 +180554,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -178891,34 +180756,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"alsoKnownAs\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -179342,34 +181217,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -179534,34 +181419,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + \\"service\\", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === \\"http:\\" || this.id.protocol === \\"https:\\") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index eed0c47f9..3c23d2465 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -540,6 +540,42 @@ function isNonPropagatingContext(context: unknown): boolean { (first as Record)["@propagate"] === false; } +// Objects whose contexts could not be rebuilt, so that neither they nor the +// objects nested in them can be decoded again from their cached JSON-LD: +const fixedCachedJsonLd = new WeakSet(); + +// Whether an embedded document under a key of the cached JSON-LD of an object +// can be decoded again. Prepending a context cannot rebuild what a context +// that does not propagate to embedded nodes, in the document or in the embedded +// document, or a property-scoped context for the key took part in: +function canDecodeCachedJsonLd( + object: object, + context: unknown, + embedded: object, + key: string, +): boolean { + return !fixedCachedJsonLd.has(object) && + !isNonPropagatingContext(context) && + !isNonPropagatingContext( + (embedded as { "@context"?: unknown })["@context"], + ) && + !hasPropertyScopedContext(context, key); +} + +// Gives an object decoded with the whole document the document it was received +// as, which a proof can cover, when it cannot be decoded from that document: +function fixCachedJsonLd(object: unknown, document: object): void { + if ( + object == null || typeof object !== "object" || + !(RAW_PROPERTY_PROTOCOL in object) + ) { + return; + } + (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = + structuredClone(document); + fixedCachedJsonLd.add(object); +} + function hasPropertyScopedContext(context: unknown, key: string): boolean { const entries = globalThis.Array.isArray(context) ? context : [context]; return entries.some((entry) => { @@ -550,29 +586,18 @@ function hasPropertyScopedContext(context: unknown, key: string): boolean { }); } -// Whether the embedded documents under a key of a compacted document can be -// decoded again in place of the values decoded for a property. The document -// has to map the key, and no other key, to the property, as a context can -// remap the key or map another term to the property, in which case the cached -// documents cannot be matched with the decoded values. An inline context -// that does not propagate to embedded nodes, in the document or in the -// embedded document, and a property-scoped context for the key rule it out as -// well, since prepending a context cannot rebuild what they were decoded with: +// Whether the embedded documents under a key of a compacted document are the +// values decoded for a property. The document has to map the key, and no other +// key, to the property, as a context can remap the key or map another term to +// the property, in which case the cached documents cannot be matched with the +// decoded values: async function isCachedPropertyKey( document: Record, context: unknown, - embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { - if ( - isNonPropagatingContext(context) || - isNonPropagatingContext((embedded as { "@context"?: unknown })["@context"]) || - hasPropertyScopedContext(context, key) - ) { - return false; - } let checks = cachedPropertyKeys.get(document); if (checks == null) { checks = new Map(); @@ -6514,34 +6539,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "attachment", ["https://www.w3.org/ns/activitystreams#attachment"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attachment_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "attachment", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#attachment_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7024,34 +7059,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "attributedTo", ["https://www.w3.org/ns/activitystreams#attributedTo"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "attributedTo", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#attribution_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7215,34 +7260,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "attributedTo", ["https://www.w3.org/ns/activitystreams#attributedTo"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "attributedTo", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#attribution_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7664,34 +7719,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "audience", ["https://www.w3.org/ns/activitystreams#audience"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "audience", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#audience_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -7854,34 +7919,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "audience", ["https://www.w3.org/ns/activitystreams#audience"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "audience", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#audience_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -8356,34 +8431,44 @@ get contents(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "context", ["https://www.w3.org/ns/activitystreams#context"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#context_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "context", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#context_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -8865,34 +8950,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "generator", ["https://www.w3.org/ns/activitystreams#generator"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#generator_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "generator", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#generator_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -9337,34 +9432,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "icon", ["https://www.w3.org/ns/activitystreams#icon"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "icon", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#icon_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -9528,34 +9633,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "icon", ["https://www.w3.org/ns/activitystreams#icon"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "icon", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#icon_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10000,34 +10115,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "image", ["https://www.w3.org/ns/activitystreams#image"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "image", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#image_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10191,34 +10316,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "image", ["https://www.w3.org/ns/activitystreams#image"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "image", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#image_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10655,34 +10790,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "inReplyTo", ["https://www.w3.org/ns/activitystreams#inReplyTo"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "inReplyTo", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#replyTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -10845,34 +10990,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "inReplyTo", ["https://www.w3.org/ns/activitystreams#inReplyTo"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "inReplyTo", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#replyTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -11309,34 +11464,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "location", ["https://www.w3.org/ns/activitystreams#location"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "location", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#location_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -11499,34 +11664,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "location", ["https://www.w3.org/ns/activitystreams#location"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "location", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#location_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -11962,34 +12137,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "preview", ["https://www.w3.org/ns/activitystreams#preview"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "preview", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#preview_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -12151,34 +12336,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "preview", ["https://www.w3.org/ns/activitystreams#preview"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "preview", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#preview_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -12613,34 +12808,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "replies", ["https://www.w3.org/ns/activitystreams#replies"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replies_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "replies", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#replies_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -13067,34 +13272,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "shares", ["https://www.w3.org/ns/activitystreams#shares"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#shares_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "shares", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#shares_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -13521,34 +13736,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "likes", ["https://www.w3.org/ns/activitystreams#likes"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likes_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "likes", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likes_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -13969,34 +14194,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "emojiReactions", ["http://fedibird.com/ns#emojiReactions"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#emojiReactions_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "emojiReactions", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#emojiReactions_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -14478,34 +14713,44 @@ get summaries(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "tag", ["https://www.w3.org/ns/activitystreams#tag"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#tag_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "tag", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#tag_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -14961,34 +15206,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "to", ["https://www.w3.org/ns/activitystreams#to"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "to", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#to_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -15151,34 +15406,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "to", ["https://www.w3.org/ns/activitystreams#to"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "to", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#to_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -15600,34 +15865,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "bto", ["https://www.w3.org/ns/activitystreams#bto"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "bto", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#bto_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -15790,34 +16065,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "bto", ["https://www.w3.org/ns/activitystreams#bto"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "bto", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#bto_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -16239,34 +16524,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "cc", ["https://www.w3.org/ns/activitystreams#cc"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "cc", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#cc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -16429,34 +16724,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "cc", ["https://www.w3.org/ns/activitystreams#cc"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "cc", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#cc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -16878,34 +17183,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "bcc", ["https://www.w3.org/ns/activitystreams#bcc"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "bcc", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#bcc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -17068,34 +17383,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "bcc", ["https://www.w3.org/ns/activitystreams#bcc"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "bcc", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#bcc_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -17580,34 +17905,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "proof", ["https://w3id.org/security#proof"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "proof", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#proof_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -17769,34 +18104,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "proof", ["https://w3id.org/security#proof"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "proof", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#proof_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -18257,34 +18602,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "likeAuthorization", ["https://gotosocial.org/ns#likeAuthorization"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likeAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "likeAuthorization", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likeAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -18705,34 +19060,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "replyAuthorization", ["https://gotosocial.org/ns#replyAuthorization"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "replyAuthorization", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#replyAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -19153,34 +19518,44 @@ get urls(): ((URL | Link))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "announceAuthorization", ["https://gotosocial.org/ns#announceAuthorization"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#announceAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "announceAuthorization", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#announceAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -25728,34 +26103,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "quote", ["https://w3id.org/fep/044f#quote"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "quote", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -26199,34 +26584,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "quoteAuthorization", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -28738,34 +29133,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "actor", ["https://www.w3.org/ns/activitystreams#actor"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "actor", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#actor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -28929,34 +29334,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "actor", ["https://www.w3.org/ns/activitystreams#actor"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "actor", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#actor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -29379,34 +29794,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "object", ["https://www.w3.org/ns/activitystreams#object"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "object", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -29570,34 +29995,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "object", ["https://www.w3.org/ns/activitystreams#object"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "object", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30023,34 +30458,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "target", ["https://www.w3.org/ns/activitystreams#target"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "target", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#target_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30217,34 +30662,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "target", ["https://www.w3.org/ns/activitystreams#target"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "target", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#target_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30667,34 +31122,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "result", ["https://www.w3.org/ns/activitystreams#result"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "result", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#result_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -30858,34 +31323,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "result", ["https://www.w3.org/ns/activitystreams#result"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "result", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#result_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -31309,34 +31784,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "origin", ["https://www.w3.org/ns/activitystreams#origin"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "origin", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#origin_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -31501,34 +31986,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "origin", ["https://www.w3.org/ns/activitystreams#origin"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "origin", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#origin_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -31950,203 +32445,20 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "instrument", ["https://www.w3.org/ns/activitystreams#instrument"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#instrument_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); - } - } catch (error) { - if (!options.suppressError) throw error; - getLogger(["fedify", "vocab"]).debug( - "Failed to parse embedded value of {property}: {error}", - { property: "https://www.w3.org/ns/activitystreams#instrument", error }, - ); - return null; - } - } - } - - if (v?.id != null && - ((this.id != null && !isTrustedIriOrigin(options, v.id, this.id)) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject( - this, this.id, v.id, options, - )) && - !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { - if (options.crossOrigin === "throw") { - throw new Error( - "The property object's @id (" + v.id.href + ") has a different " + - "origin than the property owner's @id (" + (this.id?.href ?? null) + "); " + - "refusing to return the object. If you want to bypass this " + - "check and are aware of the security implications, set the " + - 'crossOrigin option to "trust".' - ); - } - getLogger(["fedify", "vocab"]).warn( - "The property object's @id ({objectId}) has a different origin " + - "than the property owner's @id ({parentObjectId}); refusing to " + - "return the object. If you want to bypass this check and are " + - "aware of the security implications, set the crossOrigin option " + - 'to "trust".', - { objectId: v.id.href, parentObjectId: (this.id?.href ?? null) }, - ); - return null; - } - recordPortableReferrer(this, v, "https://www.w3.org/ns/activitystreams#instrument"); - return v; - } - - /** - * Similar to - * {@link Activity.getInstruments}, - * but returns their \`@id\`s instead of the objects themselves. - */ - get instrumentIds(): URL[] { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - return this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.map((v) => - v instanceof URL ? v : v.id! - ).filter(id => id !== null); - } - -/** Identifies one or more objects used (or to be used) in the completion of - * an {@link Activity}. - * - */ - - async* getInstruments( - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - suppressError?: boolean, - tracerProvider?: TracerProvider, - crossOrigin?: "ignore" | "throw" | "trust"; - gateways?: readonly (string | URL)[]; - verifyPortableObject?: PortableObjectVerifier; - /** - * Whether objects that this call newly fetches use the - * \`verifyPortableObject\` option of this call as their default - * verifier. Defaults to \`true\`. If \`false\`, the option - * applies to this call only, and fetched objects use this object's - * own default verifier, if any, as their default instead. Pass - * \`false\` for a temporary verifier, e.g., one that accepts - * everything. Objects that were already cached in this object or - * embedded in it keep their defaults either way, and this option - * itself is not passed on. - * @since 2.4.0 - */ - inheritPortableObjectVerifier?: boolean; - } = {} - ): AsyncIterable { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - if ( - options.verifyPortableObject == null && - this._verifyPortableObject != null - ) { - options = { - ...options, - verifyPortableObject: this._verifyPortableObject, - }; - } - const vs = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; - for (let i = 0; i < vs.length; i++) { - let v = vs[i]; - if (!(v instanceof URL) && - !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { - if (v.id == null) { - if (isUnsecuredPortableObject(this)) { - warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#instrument"); - continue; - } - } else if ( - !isTrustedIriOrigin(options, v.id, this.id) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject(this, this.id, v.id, options) - ) { - v = v.id; - } - } - if (v instanceof URL) { - const fetched = - await this.#fetchInstrument(v, options); - if (fetched == null) continue; - // Not cached, so that it is verified when the portable object - // policy applies later: - if (isUnverifiedPortableClaim(fetched)) { - yield fetched; - continue; - } - vs[i] = fetched; - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); - this._cachedJsonLd = undefined; - recordPortableReferrer(this, fetched, "https://www.w3.org/ns/activitystreams#instrument"); - yield fetched; - continue; - } - - if ( - this._cachedJsonLd != null && - typeof this._cachedJsonLd === "object" && - "@context" in this._cachedJsonLd && - "instrument" in this._cachedJsonLd - ) { - const prop = this._cachedJsonLd[ - "instrument"]; - const obj = Array.isArray(prop) ? prop[i] : prop; - if (obj != null && typeof obj === "object" && "@context" in obj) { - try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); - const context = getCachedJsonLdContext( - this, - this._cachedJsonLd["@context"], - ); if ( - await isCachedPropertyKey( - this._cachedJsonLd as Record, + canDecodeCachedJsonLd( + this, context, - obj, + doc, "instrument", - ["https://www.w3.org/ns/activitystreams#instrument"], - cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); + const inherited = inheritJsonLdContext(context, doc); v = await this.#instrument_fromJsonLd( inherited, { @@ -32164,10 +32476,213 @@ rawPropertyDescriptors.set(this.prototype, descriptors); ); await keepCachedJsonLd( v as object, - obj, + doc, inherited, cachedContextLoader, ); + } else { + fixCachedJsonLd(v, doc); + } + } + } catch (error) { + if (!options.suppressError) throw error; + getLogger(["fedify", "vocab"]).debug( + "Failed to parse embedded value of {property}: {error}", + { property: "https://www.w3.org/ns/activitystreams#instrument", error }, + ); + return null; + } + } + } + + if (v?.id != null && + ((this.id != null && !isTrustedIriOrigin(options, v.id, this.id)) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject( + this, this.id, v.id, options, + )) && + !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { + if (options.crossOrigin === "throw") { + throw new Error( + "The property object's @id (" + v.id.href + ") has a different " + + "origin than the property owner's @id (" + (this.id?.href ?? null) + "); " + + "refusing to return the object. If you want to bypass this " + + "check and are aware of the security implications, set the " + + 'crossOrigin option to "trust".' + ); + } + getLogger(["fedify", "vocab"]).warn( + "The property object's @id ({objectId}) has a different origin " + + "than the property owner's @id ({parentObjectId}); refusing to " + + "return the object. If you want to bypass this check and are " + + "aware of the security implications, set the crossOrigin option " + + 'to "trust".', + { objectId: v.id.href, parentObjectId: (this.id?.href ?? null) }, + ); + return null; + } + recordPortableReferrer(this, v, "https://www.w3.org/ns/activitystreams#instrument"); + return v; + } + + /** + * Similar to + * {@link Activity.getInstruments}, + * but returns their \`@id\`s instead of the objects themselves. + */ + get instrumentIds(): URL[] { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + return this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.map((v) => + v instanceof URL ? v : v.id! + ).filter(id => id !== null); + } + +/** Identifies one or more objects used (or to be used) in the completion of + * an {@link Activity}. + * + */ + + async* getInstruments( + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + suppressError?: boolean, + tracerProvider?: TracerProvider, + crossOrigin?: "ignore" | "throw" | "trust"; + gateways?: readonly (string | URL)[]; + verifyPortableObject?: PortableObjectVerifier; + /** + * Whether objects that this call newly fetches use the + * \`verifyPortableObject\` option of this call as their default + * verifier. Defaults to \`true\`. If \`false\`, the option + * applies to this call only, and fetched objects use this object's + * own default verifier, if any, as their default instead. Pass + * \`false\` for a temporary verifier, e.g., one that accepts + * everything. Objects that were already cached in this object or + * embedded in it keep their defaults either way, and this option + * itself is not passed on. + * @since 2.4.0 + */ + inheritPortableObjectVerifier?: boolean; + } = {} + ): AsyncIterable { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if ( + options.verifyPortableObject == null && + this._verifyPortableObject != null + ) { + options = { + ...options, + verifyPortableObject: this._verifyPortableObject, + }; + } + const vs = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + for (let i = 0; i < vs.length; i++) { + let v = vs[i]; + if (!(v instanceof URL) && + !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { + if (v.id == null) { + if (isUnsecuredPortableObject(this)) { + warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#instrument"); + continue; + } + } else if ( + !isTrustedIriOrigin(options, v.id, this.id) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject(this, this.id, v.id, options) + ) { + v = v.id; + } + } + if (v instanceof URL) { + const fetched = + await this.#fetchInstrument(v, options); + if (fetched == null) continue; + // Not cached, so that it is verified when the portable object + // policy applies later: + if (isUnverifiedPortableClaim(fetched)) { + yield fetched; + continue; + } + vs[i] = fetched; + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); + this._cachedJsonLd = undefined; + recordPortableReferrer(this, fetched, "https://www.w3.org/ns/activitystreams#instrument"); + yield fetched; + continue; + } + + if ( + this._cachedJsonLd != null && + typeof this._cachedJsonLd === "object" && + "@context" in this._cachedJsonLd && + "instrument" in this._cachedJsonLd + ) { + const prop = this._cachedJsonLd[ + "instrument"]; + const obj = Array.isArray(prop) ? prop[i] : prop; + if (obj != null && typeof obj === "object" && "@context" in obj) { + try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + context, + "instrument", + ["https://www.w3.org/ns/activitystreams#instrument"], + cachedContextLoader, + ) + ) { + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "instrument", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#instrument_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + this._baseUrl ?? + (this.id != null && + (this.id.protocol === "http:" || + this.id.protocol === "https:") + ? this.id + : undefined), + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -36497,34 +37012,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactingObject", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -36944,34 +37469,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactionTarget", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -41584,34 +42119,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactingObject", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -42031,34 +42576,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactionTarget", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -43974,34 +44529,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactingObject", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -44421,34 +44986,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactionTarget", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -46363,34 +46938,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactingObject", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -46810,34 +47395,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactionTarget", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -49390,207 +49985,20 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "translator", ["https://schema.org/translator"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#translator_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); - } - } catch (error) { - if (!options.suppressError) throw error; - getLogger(["fedify", "vocab"]).debug( - "Failed to parse embedded value of {property}: {error}", - { property: "https://schema.org/translator", error }, - ); - return null; - } - } - } - - if (v?.id != null && - ((!isTrustedIriOrigin(options, v.id, null)) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject( - this, null, v.id, options, - )) && - !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { - if (options.crossOrigin === "throw") { - throw new Error( - "The property object's @id (" + v.id.href + ") has a different " + - "origin than the property owner's @id (" + "untrusted metadata" + "); " + - "refusing to return the object. If you want to bypass this " + - "check and are aware of the security implications, set the " + - 'crossOrigin option to "trust".' - ); - } - getLogger(["fedify", "vocab"]).warn( - "The property object's @id ({objectId}) has a different origin " + - "than the property owner's @id ({parentObjectId}); refusing to " + - "return the object. If you want to bypass this check and are " + - "aware of the security implications, set the crossOrigin option " + - 'to "trust".', - { objectId: v.id.href, parentObjectId: "untrusted metadata" }, - ); - return null; - } - recordPortableReferrer(this, v, "https://schema.org/translator"); - return v; - } - - /** - * Similar to - * {@link Translation.getTranslators}, - * but returns their \`@id\`s instead of the objects themselves. - */ - get translatorIds(): URL[] { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - return this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.map((v) => - v instanceof URL ? v : v.id! - ).filter(id => id !== null); - } - -/** The actors credited for this language version. Their order has no - * meaning. Human actors credit translation or review; Application and - * Service actors credit machine output. If any actor cannot be resolved, - * the entry's human-or-machine status is unknown. Credit is asserted by - * the publisher and grants no publishing authority. Embedded actors with - * identifiers are fetched before being returned unless explicitly trusted. - * - */ - - async* getTranslators( - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - suppressError?: boolean, - tracerProvider?: TracerProvider, - crossOrigin?: "ignore" | "throw" | "trust"; - gateways?: readonly (string | URL)[]; - verifyPortableObject?: PortableObjectVerifier; - /** - * Whether objects that this call newly fetches use the - * \`verifyPortableObject\` option of this call as their default - * verifier. Defaults to \`true\`. If \`false\`, the option - * applies to this call only, and fetched objects use this object's - * own default verifier, if any, as their default instead. Pass - * \`false\` for a temporary verifier, e.g., one that accepts - * everything. Objects that were already cached in this object or - * embedded in it keep their defaults either way, and this option - * itself is not passed on. - * @since 2.4.0 - */ - inheritPortableObjectVerifier?: boolean; - } = {} - ): AsyncIterable { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - } - if ( - options.verifyPortableObject == null && - this._verifyPortableObject != null - ) { - options = { - ...options, - verifyPortableObject: this._verifyPortableObject, - }; - } - const vs = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; - for (let i = 0; i < vs.length; i++) { - let v = vs[i]; - if (!(v instanceof URL) && - !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { - if (v.id == null) { - if (isUnsecuredPortableObject(this)) { - warnUnverifiableEmbeddedObject(this, "https://schema.org/translator"); - continue; - } - } else if ( - !isTrustedIriOrigin(options, v.id, null) || - isUnsecuredPortableObject(this) || - mustDereferencePortableObject(this, null, v.id, options) - ) { - v = v.id; - } - } - if (v instanceof URL) { - const fetched = - await this.#fetchTranslator(v, options); - if (fetched == null) continue; - // Not cached, so that it is verified when the portable object - // policy applies later: - if (isUnverifiedPortableClaim(fetched)) { - yield fetched; - continue; - } - vs[i] = fetched; - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); - this._cachedJsonLd = undefined; - recordPortableReferrer(this, fetched, "https://schema.org/translator"); - yield fetched; - continue; - } - - if ( - this._cachedJsonLd != null && - typeof this._cachedJsonLd === "object" && - "@context" in this._cachedJsonLd && - "translator" in this._cachedJsonLd - ) { - const prop = this._cachedJsonLd[ - "translator"]; - const obj = Array.isArray(prop) ? prop[i] : prop; - if (obj != null && typeof obj === "object" && "@context" in obj) { - try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); - const context = getCachedJsonLdContext( - this, - this._cachedJsonLd["@context"], - ); if ( - await isCachedPropertyKey( - this._cachedJsonLd as Record, + canDecodeCachedJsonLd( + this, context, - obj, + doc, "translator", - ["https://schema.org/translator"], - cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); + const inherited = inheritJsonLdContext(context, doc); v = await this.#translator_fromJsonLd( inherited, { @@ -49608,10 +50016,217 @@ rawPropertyDescriptors.set(this.prototype, descriptors); ); await keepCachedJsonLd( v as object, - obj, + doc, inherited, cachedContextLoader, ); + } else { + fixCachedJsonLd(v, doc); + } + } + } catch (error) { + if (!options.suppressError) throw error; + getLogger(["fedify", "vocab"]).debug( + "Failed to parse embedded value of {property}: {error}", + { property: "https://schema.org/translator", error }, + ); + return null; + } + } + } + + if (v?.id != null && + ((!isTrustedIriOrigin(options, v.id, null)) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject( + this, null, v.id, options, + )) && + !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { + if (options.crossOrigin === "throw") { + throw new Error( + "The property object's @id (" + v.id.href + ") has a different " + + "origin than the property owner's @id (" + "untrusted metadata" + "); " + + "refusing to return the object. If you want to bypass this " + + "check and are aware of the security implications, set the " + + 'crossOrigin option to "trust".' + ); + } + getLogger(["fedify", "vocab"]).warn( + "The property object's @id ({objectId}) has a different origin " + + "than the property owner's @id ({parentObjectId}); refusing to " + + "return the object. If you want to bypass this check and are " + + "aware of the security implications, set the crossOrigin option " + + 'to "trust".', + { objectId: v.id.href, parentObjectId: "untrusted metadata" }, + ); + return null; + } + recordPortableReferrer(this, v, "https://schema.org/translator"); + return v; + } + + /** + * Similar to + * {@link Translation.getTranslators}, + * but returns their \`@id\`s instead of the objects themselves. + */ + get translatorIds(): URL[] { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + return this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.map((v) => + v instanceof URL ? v : v.id! + ).filter(id => id !== null); + } + +/** The actors credited for this language version. Their order has no + * meaning. Human actors credit translation or review; Application and + * Service actors credit machine output. If any actor cannot be resolved, + * the entry's human-or-machine status is unknown. Credit is asserted by + * the publisher and grants no publishing authority. Embedded actors with + * identifiers are fetched before being returned unless explicitly trusted. + * + */ + + async* getTranslators( + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + suppressError?: boolean, + tracerProvider?: TracerProvider, + crossOrigin?: "ignore" | "throw" | "trust"; + gateways?: readonly (string | URL)[]; + verifyPortableObject?: PortableObjectVerifier; + /** + * Whether objects that this call newly fetches use the + * \`verifyPortableObject\` option of this call as their default + * verifier. Defaults to \`true\`. If \`false\`, the option + * applies to this call only, and fetched objects use this object's + * own default verifier, if any, as their default instead. Pass + * \`false\` for a temporary verifier, e.g., one that accepts + * everything. Objects that were already cached in this object or + * embedded in it keep their defaults either way, and this option + * itself is not passed on. + * @since 2.4.0 + */ + inheritPortableObjectVerifier?: boolean; + } = {} + ): AsyncIterable { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + } + if ( + options.verifyPortableObject == null && + this._verifyPortableObject != null + ) { + options = { + ...options, + verifyPortableObject: this._verifyPortableObject, + }; + } + const vs = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; + for (let i = 0; i < vs.length; i++) { + let v = vs[i]; + if (!(v instanceof URL) && + !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { + if (v.id == null) { + if (isUnsecuredPortableObject(this)) { + warnUnverifiableEmbeddedObject(this, "https://schema.org/translator"); + continue; + } + } else if ( + !isTrustedIriOrigin(options, v.id, null) || + isUnsecuredPortableObject(this) || + mustDereferencePortableObject(this, null, v.id, options) + ) { + v = v.id; + } + } + if (v instanceof URL) { + const fetched = + await this.#fetchTranslator(v, options); + if (fetched == null) continue; + // Not cached, so that it is verified when the portable object + // policy applies later: + if (isUnverifiedPortableClaim(fetched)) { + yield fetched; + continue; + } + vs[i] = fetched; + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); + this._cachedJsonLd = undefined; + recordPortableReferrer(this, fetched, "https://schema.org/translator"); + yield fetched; + continue; + } + + if ( + this._cachedJsonLd != null && + typeof this._cachedJsonLd === "object" && + "@context" in this._cachedJsonLd && + "translator" in this._cachedJsonLd + ) { + const prop = this._cachedJsonLd[ + "translator"]; + const obj = Array.isArray(prop) ? prop[i] : prop; + if (obj != null && typeof obj === "object" && "@context" in obj) { + try { + const cachedContextLoader = options.contextLoader ?? + this._contextLoader ?? getDocumentLoader(); + const context = getCachedJsonLdContext( + this, + this._cachedJsonLd["@context"], + ); + if ( + await isCachedPropertyKey( + this._cachedJsonLd as Record, + context, + "translator", + ["https://schema.org/translator"], + cachedContextLoader, + ) + ) { + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "translator", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#translator_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + this._baseUrl ?? + (this.id != null && + (this.id.protocol === "http:" || + this.id.protocol === "https:") + ? this.id + : undefined), + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -51459,34 +52074,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactingObject", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactingObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -51905,34 +52530,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "interactionTarget", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#interactionTarget_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -54836,34 +55471,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "current", ["https://www.w3.org/ns/activitystreams#current"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#current_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "current", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#current_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -55284,34 +55929,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "first", ["https://www.w3.org/ns/activitystreams#first"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#first_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "first", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#first_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -55732,34 +56387,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "last", ["https://www.w3.org/ns/activitystreams#last"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#last_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "last", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#last_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -56199,34 +56864,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "items", ["https://www.w3.org/ns/activitystreams#items"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "items", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#item_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -56647,34 +57322,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "likesOf", ["https://w3id.org/fep/5711#likesOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likesOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "likesOf", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likesOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -57094,34 +57779,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "sharesOf", ["https://w3id.org/fep/5711#sharesOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#sharesOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "sharesOf", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#sharesOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -57541,34 +58236,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "repliesOf", ["https://w3id.org/fep/5711#repliesOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#repliesOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "repliesOf", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#repliesOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -57988,34 +58693,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "inboxOf", ["https://w3id.org/fep/5711#inboxOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inboxOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "inboxOf", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inboxOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -58435,34 +59150,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "outboxOf", ["https://w3id.org/fep/5711#outboxOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outboxOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "outboxOf", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outboxOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -58882,34 +59607,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "followersOf", ["https://w3id.org/fep/5711#followersOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followersOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "followersOf", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followersOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -59329,34 +60064,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "followingOf", ["https://w3id.org/fep/5711#followingOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followingOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "followingOf", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followingOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -59776,34 +60521,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "likedOf", ["https://w3id.org/fep/5711#likedOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likedOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "likedOf", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#likedOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -62399,34 +63154,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "orderedItems", ["https://www.w3.org/ns/activitystreams#items"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "orderedItems", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#item_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -64611,34 +65376,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredObject", ["https://w3id.org/fep/7aa9#featuredObject"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredObject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredObject", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredObject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -65059,34 +65834,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featureAuthorization", ["https://w3id.org/fep/7aa9#featureAuthorization"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featureAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featureAuthorization", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featureAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -69695,34 +70480,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "owner", ["https://w3id.org/security#owner"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#owner_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "owner", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#owner_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -71262,34 +72057,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "controller", ["https://w3id.org/security#controller"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#controller_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "controller", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#controller_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -81613,34 +82418,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -81801,34 +82616,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -82252,34 +83077,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -82444,34 +83279,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -82965,34 +83810,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "inbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -83436,34 +84291,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "outbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -83887,34 +84752,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "following", ["https://www.w3.org/ns/activitystreams#following"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "following", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -84341,34 +85216,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "followers", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -84793,34 +85678,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "liked", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -85243,34 +86138,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featured", ["http://joinmastodon.org/ns#featured"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featured", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -85693,34 +86598,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredTags", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -86140,34 +87055,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredCollections", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -86591,34 +87516,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "streams", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -87184,34 +88119,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "movedTo", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -87694,34 +88639,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -87886,34 +88841,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -88337,34 +89302,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -88529,34 +89504,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -93757,34 +94742,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "quote", ["https://w3id.org/fep/044f#quote"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "quote", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -94228,34 +95223,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "quoteAuthorization", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -98471,34 +99476,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "partOf", ["https://www.w3.org/ns/activitystreams#partOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#partOf_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "partOf", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#partOf_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -98917,34 +99932,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "next", ["https://www.w3.org/ns/activitystreams#next"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#next_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "next", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#next_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -99364,34 +100389,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "prev", ["https://www.w3.org/ns/activitystreams#prev"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#prev_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "prev", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#prev_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -108499,34 +109534,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -108687,34 +109732,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -109138,34 +110193,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -109330,34 +110395,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -109851,34 +110926,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "inbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -110322,34 +111407,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "outbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -110773,34 +111868,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "following", ["https://www.w3.org/ns/activitystreams#following"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "following", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -111227,34 +112332,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "followers", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -111679,34 +112794,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "liked", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -112129,34 +113254,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featured", ["http://joinmastodon.org/ns#featured"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featured", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -112579,34 +113714,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredTags", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -113026,34 +114171,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredCollections", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -113477,34 +114632,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "streams", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -114070,34 +115235,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "movedTo", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -114580,34 +115755,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -114772,34 +115957,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -115223,34 +116418,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -115415,34 +116620,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -120499,34 +121714,44 @@ get names(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "preview", ["https://www.w3.org/ns/activitystreams#preview"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "preview", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#preview_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -127974,34 +129199,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "quote", ["https://w3id.org/fep/044f#quote"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "quote", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -128445,34 +129680,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "quoteAuthorization", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -130000,34 +131245,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "orderedItems", ["https://www.w3.org/ns/activitystreams#items"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "orderedItems", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#item_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -133940,34 +135195,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -134128,34 +135393,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -134579,34 +135854,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -134771,34 +136056,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -135292,34 +136587,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "inbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -135763,34 +137068,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "outbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -136214,34 +137529,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "following", ["https://www.w3.org/ns/activitystreams#following"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "following", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -136668,34 +137993,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "followers", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -137120,34 +138455,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "liked", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -137570,34 +138915,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featured", ["http://joinmastodon.org/ns#featured"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featured", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -138020,34 +139375,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredTags", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -138467,34 +139832,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredCollections", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -138918,34 +140293,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "streams", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -139511,34 +140896,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "movedTo", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140021,34 +141416,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140213,34 +141618,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140664,34 +142079,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -140856,34 +142281,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -147989,34 +149424,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -148177,34 +149622,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -148628,34 +150083,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -148820,34 +150285,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -149341,34 +150816,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "inbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -149812,34 +151297,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "outbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -150263,34 +151758,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "following", ["https://www.w3.org/ns/activitystreams#following"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "following", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -150717,34 +152222,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "followers", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -151169,34 +152684,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "liked", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -151619,34 +153144,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featured", ["http://joinmastodon.org/ns#featured"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featured", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -152069,34 +153604,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredTags", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -152516,34 +154061,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredCollections", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -152967,34 +154522,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "streams", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -153560,34 +155125,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "movedTo", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154070,34 +155645,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154262,34 +155847,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154713,34 +156308,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -154905,34 +156510,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -160429,34 +162044,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "describes", ["https://www.w3.org/ns/activitystreams#describes"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#describes_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "describes", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#describes_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -162219,34 +163844,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "oneOf", ["https://www.w3.org/ns/activitystreams#oneOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#exclusiveOption_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "oneOf", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#exclusiveOption_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -162673,34 +164308,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "anyOf", ["https://www.w3.org/ns/activitystreams#anyOf"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#inclusiveOption_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "anyOf", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#inclusiveOption_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -163153,34 +164798,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "quote", ["https://w3id.org/fep/044f#quote"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "quote", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quote_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -163624,34 +165279,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "quoteAuthorization", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#quoteAuthorization_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -166756,34 +168421,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "subject", ["https://www.w3.org/ns/activitystreams#subject"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#subject_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "subject", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#subject_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -167203,34 +168878,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "object", ["https://www.w3.org/ns/activitystreams#object"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "object", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -167392,34 +169077,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "object", ["https://www.w3.org/ns/activitystreams#object"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "object", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#object_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -167842,34 +169537,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "relationship", ["https://www.w3.org/ns/activitystreams#relationship"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "relationship", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#relationship_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -168033,34 +169738,44 @@ rawPropertyDescriptors.set(this.prototype, descriptors); await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "relationship", ["https://www.w3.org/ns/activitystreams#relationship"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "relationship", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#relationship_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -172620,34 +174335,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -172808,34 +174533,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "publicKey", ["https://w3id.org/security#publicKey"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "publicKey", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#publicKey_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -173259,34 +174994,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -173451,34 +175196,44 @@ get preferredUsernames(): ((string | LanguageString))[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "assertionMethod", ["https://w3id.org/security#assertionMethod"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "assertionMethod", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#assertionMethod_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -173972,34 +175727,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "inbox", ["http://www.w3.org/ns/ldp#inbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "inbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#inbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -174443,34 +176208,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "outbox", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#outbox_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -174894,34 +176669,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "following", ["https://www.w3.org/ns/activitystreams#following"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "following", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#following_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -175348,34 +177133,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "followers", ["https://www.w3.org/ns/activitystreams#followers"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "followers", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#followers_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -175800,34 +177595,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "liked", ["https://www.w3.org/ns/activitystreams#liked"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "liked", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#liked_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -176250,34 +178055,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featured", ["http://joinmastodon.org/ns#featured"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featured", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featured_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -176700,34 +178515,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredTags", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredTags_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -177147,34 +178972,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "featuredCollections", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#featuredCollections_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -177598,34 +179433,44 @@ get gateways(): (URL)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "streams", ["https://www.w3.org/ns/activitystreams#streams"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "streams", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#stream_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -178191,34 +180036,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "movedTo", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#successor_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -178701,34 +180556,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -178893,34 +180758,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "alsoKnownAs", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#alias_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; @@ -179344,34 +181219,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -179536,34 +181421,44 @@ get attributionDomains(): (string)[] { await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, "service", ["https://www.w3.org/ns/did#service"], cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + "service", + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#service_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this._baseUrl ?? (this.id != null && (this.id.protocol === "http:" || this.id.protocol === "https:") ? this.id : undefined), - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index 22e01e15c..ffa5cd2d1 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -501,7 +501,6 @@ async function* generateProperty( await isCachedPropertyKey( this._cachedJsonLd as Record, context, - doc, ${JSON.stringify(property.compactName)}, ${ JSON.stringify([ @@ -512,22 +511,33 @@ async function* generateProperty( cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#${property.singularName}_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: ${cachedPropertyBaseUrl}, - }, - ); - await keepCachedJsonLd( - v as object, - doc, - inherited, - cachedContextLoader, - ); + if ( + canDecodeCachedJsonLd( + this, + context, + doc, + ${JSON.stringify(property.compactName)}, + ) + ) { + const inherited = inheritJsonLdContext(context, doc); + v = await this.#${property.singularName}_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: ${cachedPropertyBaseUrl}, + }, + ); + await keepCachedJsonLd( + v as object, + doc, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, doc); + } } } catch (error) { if (!options.suppressError) throw error; @@ -714,7 +724,6 @@ async function* generateProperty( await isCachedPropertyKey( this._cachedJsonLd as Record, context, - obj, ${JSON.stringify(property.compactName)}, ${ JSON.stringify([ @@ -725,22 +734,33 @@ async function* generateProperty( cachedContextLoader, ) ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#${property.singularName}_fromJsonLd( - inherited, - { - ...options, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: ${cachedPropertyBaseUrl}, - }, - ); - await keepCachedJsonLd( - v as object, - obj, - inherited, - cachedContextLoader, - ); + if ( + canDecodeCachedJsonLd( + this, + context, + obj, + ${JSON.stringify(property.compactName)}, + ) + ) { + const inherited = inheritJsonLdContext(context, obj); + v = await this.#${property.singularName}_fromJsonLd( + inherited, + { + ...options, + // Keep the parent default for embedded objects. + verifyPortableObject: this._verifyPortableObject, + baseUrl: ${cachedPropertyBaseUrl}, + }, + ); + await keepCachedJsonLd( + v as object, + obj, + inherited, + cachedContextLoader, + ); + } else { + fixCachedJsonLd(v, obj); + } } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index ab0782110..e921188d0 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -217,6 +217,42 @@ function isNonPropagatingContext(context: unknown): boolean { (first as Record)["@propagate"] === false; } +// Objects whose contexts could not be rebuilt, so that neither they nor the +// objects nested in them can be decoded again from their cached JSON-LD: +const fixedCachedJsonLd = new WeakSet(); + +// Whether an embedded document under a key of the cached JSON-LD of an object +// can be decoded again. Prepending a context cannot rebuild what a context +// that does not propagate to embedded nodes, in the document or in the embedded +// document, or a property-scoped context for the key took part in: +function canDecodeCachedJsonLd( + object: object, + context: unknown, + embedded: object, + key: string, +): boolean { + return !fixedCachedJsonLd.has(object) && + !isNonPropagatingContext(context) && + !isNonPropagatingContext( + (embedded as { "@context"?: unknown })["@context"], + ) && + !hasPropertyScopedContext(context, key); +} + +// Gives an object decoded with the whole document the document it was received +// as, which a proof can cover, when it cannot be decoded from that document: +function fixCachedJsonLd(object: unknown, document: object): void { + if ( + object == null || typeof object !== "object" || + !(RAW_PROPERTY_PROTOCOL in object) + ) { + return; + } + (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = + structuredClone(document); + fixedCachedJsonLd.add(object); +} + function hasPropertyScopedContext(context: unknown, key: string): boolean { const entries = globalThis.Array.isArray(context) ? context : [context]; return entries.some((entry) => { @@ -227,29 +263,18 @@ function hasPropertyScopedContext(context: unknown, key: string): boolean { }); } -// Whether the embedded documents under a key of a compacted document can be -// decoded again in place of the values decoded for a property. The document -// has to map the key, and no other key, to the property, as a context can -// remap the key or map another term to the property, in which case the cached -// documents cannot be matched with the decoded values. An inline context -// that does not propagate to embedded nodes, in the document or in the -// embedded document, and a property-scoped context for the key rule it out as -// well, since prepending a context cannot rebuild what they were decoded with: +// Whether the embedded documents under a key of a compacted document are the +// values decoded for a property. The document has to map the key, and no other +// key, to the property, as a context can remap the key or map another term to +// the property, in which case the cached documents cannot be matched with the +// decoded values: async function isCachedPropertyKey( document: Record, context: unknown, - embedded: object, key: string, iris: readonly string[], contextLoader: DocumentLoader, ): Promise { - if ( - isNonPropagatingContext(context) || - isNonPropagatingContext((embedded as { "@context"?: unknown })["@context"]) || - hasPropertyScopedContext(context, key) - ) { - return false; - } let checks = cachedPropertyKeys.get(document); if (checks == null) { checks = new Map(); diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index 7106787d8..a2fbfc8d9 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -387,6 +387,34 @@ test("accessors do not load contexts once per field of a cached document", async ok(loads <= 5, `Loaded the context ${loads} times.`); }); +test("embedded objects keep their received JSON-LD on the fallback path", async () => { + const object = { + "@context": AS, + id: "https://example.com/notes/1", + type: "Note", + content: "Hello", + // A signature can cover a property that typed values cannot rebuild: + [STRUCTURED_URL]: { "@id": "https://example.com/data/1" }, + }; + for ( + const context of [ + [AS, { object: { "@id": `${AS}#object`, "@context": {} } }], + [{ "@propagate": false, body: `${AS}#content` }, AS], + ] + ) { + const create = await Create.fromJsonLd({ + "@context": context, + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object, + }); + const note = await create.getObject(); + ok(note instanceof Note); + deepStrictEqual(await note.toJsonLd(), object); + } +}); + test("embedded objects keep values under property-scoped contexts", async () => { const create = await Create.fromJsonLd({ "@context": [AS, { From 4a18a471093f76290ab0402292a2bb8a2e8543f0 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Sat, 7 Nov 2026 01:09:24 +0900 Subject: [PATCH 33/35] Harden decoding of cached embedded objects This commit includes the following changes to how accessors decode embedded objects from their parent's cached JSON-LD: - Each embedded document was decoded with the parent's context on its own, so a remote parent context was loaded once per embedded object: 50 attachments caused 102 loads. The accessors now share a context loader per cached document that loads each URL once and forgets failures. - A type-scoped context of the parent can override terms for embedded nodes too, which prepending the parent's context does not reproduce. Any inline scoped context now rules out decoding again, not only one on the property's term. - A preprocessor can return a scalar for a mixed range, which keepCachedJsonLd() would have used as a WeakMap key. It now leaves such values alone. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4494158172 https://github.com/fedify-dev/fedify/pull/1356#discussion_r4494158160 https://github.com/fedify-dev/fedify/pull/1356#discussion_r4494060880 Assisted-by: Claude Code:claude-opus-5-5 --- .../src/__snapshots__/class.test.ts.deno.snap | 2119 +++++++++++------ .../src/__snapshots__/class.test.ts.node.snap | 2119 +++++++++++------ .../src/__snapshots__/class.test.ts.snap | 2119 +++++++++++------ packages/vocab-tools/src/property.ts | 22 +- packages/vocab-tools/src/raw-property.ts | 62 +- packages/vocab/src/raw-property.test.ts | 56 + 6 files changed, 4197 insertions(+), 2300 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index f6fe9c1cb..a355850a4 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -434,12 +434,15 @@ function getCachedJsonLdContext(object: object, context: unknown): unknown { // Puts the document an embedded object was received as back into its cache, // after decoding it from the result of inheritJsonLdContext(): async function keepCachedJsonLd( - object: object, + object: unknown, document: object, decoded: object, contextLoader: DocumentLoader, ): Promise { - if (decoded === document) return; + // A preprocessor can turn the value into a scalar: + if (decoded === document || object == null || typeof object !== \\"object\\") { + return; + } const target = object as unknown as { _cachedJsonLd?: unknown }; const cached = target._cachedJsonLd; if (cached == null) return; @@ -547,19 +550,18 @@ const fixedCachedJsonLd = new WeakSet(); // Whether an embedded document under a key of the cached JSON-LD of an object // can be decoded again. Prepending a context cannot rebuild what a context // that does not propagate to embedded nodes, in the document or in the embedded -// document, or a property-scoped context for the key took part in: +// document, or a type-scoped or property-scoped context took part in: function canDecodeCachedJsonLd( object: object, context: unknown, embedded: object, - key: string, ): boolean { return !fixedCachedJsonLd.has(object) && !isNonPropagatingContext(context) && !isNonPropagatingContext( (embedded as { \\"@context\\"?: unknown })[\\"@context\\"], ) && - !hasPropertyScopedContext(context, key); + !hasScopedContext(context); } // Gives an object decoded with the whole document the document it was received @@ -576,14 +578,50 @@ function fixCachedJsonLd(object: unknown, document: object): void { fixedCachedJsonLd.add(object); } -function hasPropertyScopedContext(context: unknown, key: string): boolean { +function hasScopedContext(context: unknown): boolean { const entries = globalThis.Array.isArray(context) ? context : [context]; - return entries.some((entry) => { - const term = entry != null && typeof entry === \\"object\\" - ? (entry as Record)[key] - : undefined; - return term != null && typeof term === \\"object\\" && \\"@context\\" in term; - }); + return entries.some((entry) => + entry != null && typeof entry === \\"object\\" && + globalThis.Object.values(entry).some((term) => + term != null && typeof term === \\"object\\" && \\"@context\\" in term + ) + ); +} + +// Context loaders that load each URL once, keyed by the cached document whose +// embedded documents they decode and then by the wrapped loader. The documents +// can come from a remote peer, and decoding each of them with the parent's +// context must not multiply outbound requests by their number: +const sharedContextLoaders = new WeakMap< + object, + WeakMap +>(); + +function shareContextLoader( + document: object, + contextLoader: DocumentLoader, +): DocumentLoader { + let loaders = sharedContextLoaders.get(document); + if (loaders == null) { + loaders = new WeakMap(); + sharedContextLoaders.set(document, loaders); + } + let shared = loaders.get(contextLoader); + if (shared == null) { + const loads = new Map>(); + shared = (url, options) => { + let load = loads.get(url); + if (load == null) { + load = contextLoader(url, options); + loads.set(url, load); + // A failure is not remembered, so that a later call can try again: + load.catch(() => loads.delete(url)); + } + return load; + }; + loaders.set(contextLoader, shared); + } + return shared; } // Whether the embedded documents under a key of a compacted document are the @@ -6529,8 +6567,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -6549,7 +6590,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"attachment\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -6557,6 +6597,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -6569,7 +6610,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -7049,8 +7090,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7069,7 +7113,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"attributedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -7077,6 +7120,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7089,7 +7133,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -7250,8 +7294,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7270,7 +7317,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"attributedTo\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -7278,6 +7324,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7290,7 +7337,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -7709,8 +7756,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7729,7 +7779,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"audience\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -7737,6 +7786,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7749,7 +7799,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -7909,8 +7959,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7929,7 +7982,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"audience\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -7937,6 +7989,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7949,7 +8002,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -8421,8 +8474,11 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -8441,7 +8497,6 @@ get contents(): ((string | LanguageString))[] { this, context, obj, - \\"context\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -8449,6 +8504,7 @@ get contents(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -8461,7 +8517,7 @@ get contents(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -8940,8 +8996,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -8960,7 +9019,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"generator\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -8968,6 +9026,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -8980,7 +9039,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -9422,8 +9481,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9442,7 +9504,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"icon\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -9450,6 +9511,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -9462,7 +9524,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -9623,8 +9685,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9643,7 +9708,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"icon\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -9651,6 +9715,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -9663,7 +9728,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -10105,8 +10170,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10125,7 +10193,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"image\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -10133,6 +10200,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -10145,7 +10213,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -10306,8 +10374,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10326,7 +10397,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"image\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -10334,6 +10404,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -10346,7 +10417,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -10780,8 +10851,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10800,7 +10874,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"inReplyTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -10808,6 +10881,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -10820,7 +10894,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -10980,8 +11054,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11000,7 +11077,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"inReplyTo\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -11008,6 +11084,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -11020,7 +11097,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -11454,8 +11531,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11474,7 +11554,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"location\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -11482,6 +11561,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -11494,7 +11574,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -11654,8 +11734,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11674,7 +11757,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"location\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -11682,6 +11764,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -11694,7 +11777,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -12127,8 +12210,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12147,7 +12233,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"preview\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -12155,6 +12240,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -12167,7 +12253,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -12326,8 +12412,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12346,7 +12435,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"preview\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -12354,6 +12442,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -12366,7 +12455,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -12798,8 +12887,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12818,7 +12910,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"replies\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -12826,6 +12917,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -12838,7 +12930,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -13262,8 +13354,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -13282,7 +13377,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"shares\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -13290,6 +13384,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -13302,7 +13397,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -13726,8 +13821,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -13746,7 +13844,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"likes\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -13754,6 +13851,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -13766,7 +13864,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -14184,8 +14282,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -14204,7 +14305,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"emojiReactions\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -14212,6 +14312,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -14224,7 +14325,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -14703,8 +14804,11 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -14723,7 +14827,6 @@ get summaries(): ((string | LanguageString))[] { this, context, obj, - \\"tag\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -14731,6 +14834,7 @@ get summaries(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -14743,7 +14847,7 @@ get summaries(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -15196,8 +15300,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15216,7 +15323,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"to\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -15224,6 +15330,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -15236,7 +15343,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -15396,8 +15503,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15416,7 +15526,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"to\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -15424,6 +15533,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -15436,7 +15546,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -15855,8 +15965,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15875,7 +15988,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"bto\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -15883,6 +15995,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -15895,7 +16008,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -16055,8 +16168,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16075,7 +16191,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"bto\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -16083,6 +16198,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -16095,7 +16211,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -16514,8 +16630,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16534,7 +16653,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"cc\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -16542,6 +16660,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -16554,7 +16673,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -16714,8 +16833,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16734,7 +16856,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"cc\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -16742,6 +16863,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -16754,7 +16876,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -17173,8 +17295,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17193,7 +17318,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"bcc\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -17201,6 +17325,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -17213,7 +17338,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -17373,8 +17498,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17393,7 +17521,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"bcc\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -17401,6 +17528,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -17413,7 +17541,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -17895,8 +18023,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17915,7 +18046,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"proof\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -17923,6 +18053,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -17935,7 +18066,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -18094,8 +18225,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18114,7 +18248,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"proof\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -18122,6 +18255,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -18134,7 +18268,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -18592,8 +18726,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18612,7 +18749,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"likeAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -18620,6 +18756,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -18632,7 +18769,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -19050,8 +19187,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -19070,7 +19210,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"replyAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -19078,6 +19217,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -19090,7 +19230,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -19508,8 +19648,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -19528,7 +19671,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"announceAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -19536,6 +19678,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -19548,7 +19691,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -26093,8 +26236,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -26113,7 +26259,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quote\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -26121,6 +26266,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -26133,7 +26279,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -26574,8 +26720,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -26594,7 +26743,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quoteAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -26602,6 +26750,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -26614,7 +26763,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -29123,8 +29272,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29143,7 +29295,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"actor\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -29151,6 +29302,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -29163,7 +29315,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -29324,8 +29476,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29344,7 +29499,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"actor\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -29352,6 +29506,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -29364,7 +29519,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -29784,8 +29939,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29804,7 +29962,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"object\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -29812,6 +29969,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -29824,7 +29982,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -29985,8 +30143,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30005,7 +30166,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"object\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -30013,6 +30173,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -30025,7 +30186,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -30448,8 +30609,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30468,7 +30632,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"target\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -30476,6 +30639,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -30488,7 +30652,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -30652,8 +30816,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30672,7 +30839,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"target\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -30680,6 +30846,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -30692,7 +30859,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -31112,8 +31279,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31132,7 +31302,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"result\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -31140,6 +31309,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -31152,7 +31322,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -31313,8 +31483,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31333,7 +31506,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"result\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -31341,6 +31513,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -31353,7 +31526,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -31774,8 +31947,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31794,7 +31970,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"origin\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -31802,6 +31977,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -31814,7 +31990,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -31976,8 +32152,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31996,7 +32175,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"origin\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -32004,6 +32182,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -32016,7 +32195,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -32435,8 +32614,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32455,7 +32637,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"instrument\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -32463,6 +32644,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -32475,7 +32657,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -32635,8 +32817,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32655,7 +32840,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"instrument\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -32663,6 +32847,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -32675,7 +32860,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -37002,8 +37187,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -37022,7 +37210,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -37030,6 +37217,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -37042,7 +37230,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -37459,8 +37647,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -37479,7 +37670,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -37487,6 +37677,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -37499,7 +37690,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -42109,8 +42300,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -42129,7 +42323,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -42137,6 +42330,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -42149,7 +42343,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -42566,8 +42760,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -42586,7 +42783,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -42594,6 +42790,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -42606,7 +42803,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -44519,8 +44716,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -44539,7 +44739,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -44547,6 +44746,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -44559,7 +44759,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -44976,8 +45176,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -44996,7 +45199,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -45004,6 +45206,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -45016,7 +45219,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -46928,8 +47131,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -46948,7 +47154,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -46956,6 +47161,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -46968,7 +47174,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -47385,8 +47591,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -47405,7 +47614,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -47413,6 +47621,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -47425,7 +47634,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -49975,8 +50184,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -49995,7 +50207,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"translator\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -50003,6 +50214,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -50015,7 +50227,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -50179,8 +50391,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -50199,7 +50414,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"translator\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -50207,6 +50421,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -50219,7 +50434,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -52064,8 +52279,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -52084,7 +52302,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -52092,6 +52309,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -52104,7 +52322,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -52520,8 +52738,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -52540,7 +52761,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -52548,6 +52768,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -52560,7 +52781,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -55461,8 +55682,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -55481,7 +55705,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"current\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -55489,6 +55712,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -55501,7 +55725,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -55919,8 +56143,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -55939,7 +56166,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"first\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -55947,6 +56173,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -55959,7 +56186,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -56377,8 +56604,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -56397,7 +56627,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"last\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -56405,6 +56634,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -56417,7 +56647,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -56854,8 +57084,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -56874,7 +57107,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"items\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -56882,6 +57114,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -56894,7 +57127,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -57312,8 +57545,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -57332,7 +57568,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"likesOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -57340,6 +57575,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -57352,7 +57588,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -57769,8 +58005,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -57789,7 +58028,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"sharesOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -57797,6 +58035,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -57809,7 +58048,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -58226,8 +58465,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58246,7 +58488,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"repliesOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -58254,6 +58495,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -58266,7 +58508,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -58683,8 +58925,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58703,7 +58948,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"inboxOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -58711,6 +58955,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -58723,7 +58968,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -59140,8 +59385,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -59160,7 +59408,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"outboxOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -59168,6 +59415,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -59180,7 +59428,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -59597,8 +59845,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -59617,7 +59868,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"followersOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -59625,6 +59875,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -59637,7 +59888,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -60054,8 +60305,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -60074,7 +60328,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"followingOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -60082,6 +60335,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -60094,7 +60348,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -60511,8 +60765,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -60531,7 +60788,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"likedOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -60539,6 +60795,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -60551,7 +60808,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -63144,8 +63401,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -63164,7 +63424,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"orderedItems\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -63172,6 +63431,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -63184,7 +63444,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -65366,8 +65626,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -65386,7 +65649,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"featuredObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -65394,6 +65656,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -65406,7 +65669,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -65824,8 +66087,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -65844,7 +66110,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"featureAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -65852,6 +66117,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -65864,7 +66130,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -70470,8 +70736,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -70490,7 +70759,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"owner\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -70498,6 +70766,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -70510,7 +70779,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -72047,8 +72316,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -72067,7 +72339,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"controller\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -72075,6 +72346,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -72087,7 +72359,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -82408,8 +82680,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -82428,7 +82703,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -82436,6 +82710,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -82448,7 +82723,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -82606,8 +82881,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -82626,7 +82904,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -82634,6 +82911,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -82646,7 +82924,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -83067,8 +83345,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83087,7 +83368,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -83095,6 +83375,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -83107,7 +83388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -83269,8 +83550,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83289,7 +83573,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -83297,6 +83580,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -83309,7 +83593,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -83800,8 +84084,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83820,7 +84107,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -83828,6 +84114,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -83840,7 +84127,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -84281,8 +84568,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -84301,7 +84591,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -84309,6 +84598,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -84321,7 +84611,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -84742,8 +85032,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -84762,7 +85055,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -84770,6 +85062,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -84782,7 +85075,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -85206,8 +85499,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85226,7 +85522,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -85234,6 +85529,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -85246,7 +85542,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -85668,8 +85964,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85688,7 +85987,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -85696,6 +85994,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -85708,7 +86007,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -86128,8 +86427,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -86148,7 +86450,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -86156,6 +86457,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -86168,7 +86470,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -86588,8 +86890,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -86608,7 +86913,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -86616,6 +86920,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -86628,7 +86933,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -87045,8 +87350,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -87065,7 +87373,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -87073,6 +87380,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -87085,7 +87393,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -87506,8 +87814,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -87526,7 +87837,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -87534,6 +87844,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -87546,7 +87857,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -88109,8 +88420,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88129,7 +88443,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -88137,6 +88450,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -88149,7 +88463,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -88629,8 +88943,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88649,7 +88966,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -88657,6 +88973,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -88669,7 +88986,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -88831,8 +89148,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88851,7 +89171,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -88859,6 +89178,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -88871,7 +89191,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -89292,8 +89612,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89312,7 +89635,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -89320,6 +89642,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -89332,7 +89655,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -89494,8 +89817,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89514,7 +89840,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -89522,6 +89847,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -89534,7 +89860,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -94732,8 +95058,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -94752,7 +95081,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quote\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -94760,6 +95088,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -94772,7 +95101,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -95213,8 +95542,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -95233,7 +95565,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quoteAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -95241,6 +95572,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -95253,7 +95585,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -99466,8 +99798,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -99486,7 +99821,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"partOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -99494,6 +99828,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -99506,7 +99841,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -99922,8 +100257,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -99942,7 +100280,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"next\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -99950,6 +100287,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -99962,7 +100300,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -100379,8 +100717,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -100399,7 +100740,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"prev\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -100407,6 +100747,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -100419,7 +100760,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -109524,8 +109865,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -109544,7 +109888,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -109552,6 +109895,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -109564,7 +109908,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -109722,8 +110066,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -109742,7 +110089,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -109750,6 +110096,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -109762,7 +110109,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -110183,8 +110530,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110203,7 +110553,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -110211,6 +110560,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -110223,7 +110573,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -110385,8 +110735,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110405,7 +110758,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -110413,6 +110765,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -110425,7 +110778,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -110916,8 +111269,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110936,7 +111292,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -110944,6 +111299,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -110956,7 +111312,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -111397,8 +111753,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -111417,7 +111776,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -111425,6 +111783,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -111437,7 +111796,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -111858,8 +112217,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -111878,7 +112240,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -111886,6 +112247,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -111898,7 +112260,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -112322,8 +112684,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -112342,7 +112707,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -112350,6 +112714,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -112362,7 +112727,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -112784,8 +113149,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -112804,7 +113172,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -112812,6 +113179,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -112824,7 +113192,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -113244,8 +113612,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -113264,7 +113635,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -113272,6 +113642,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -113284,7 +113655,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -113704,8 +114075,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -113724,7 +114098,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -113732,6 +114105,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -113744,7 +114118,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -114161,8 +114535,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -114181,7 +114558,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -114189,6 +114565,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -114201,7 +114578,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -114622,8 +114999,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -114642,7 +115022,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -114650,6 +115029,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -114662,7 +115042,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -115225,8 +115605,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115245,7 +115628,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -115253,6 +115635,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -115265,7 +115648,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -115745,8 +116128,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115765,7 +116151,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -115773,6 +116158,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -115785,7 +116171,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -115947,8 +116333,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115967,7 +116356,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -115975,6 +116363,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -115987,7 +116376,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -116408,8 +116797,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116428,7 +116820,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -116436,6 +116827,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -116448,7 +116840,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -116610,8 +117002,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116630,7 +117025,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -116638,6 +117032,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -116650,7 +117045,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -121704,8 +122099,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -121724,7 +122122,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"preview\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -121732,6 +122129,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -121744,7 +122142,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -129189,8 +129587,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -129209,7 +129610,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quote\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -129217,6 +129617,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -129229,7 +129630,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -129670,8 +130071,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -129690,7 +130094,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quoteAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -129698,6 +130101,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -129710,7 +130114,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -131235,8 +131639,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -131255,7 +131662,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"orderedItems\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -131263,6 +131669,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -131275,7 +131682,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -135185,8 +135592,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135205,7 +135615,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -135213,6 +135622,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -135225,7 +135635,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -135383,8 +135793,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135403,7 +135816,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -135411,6 +135823,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -135423,7 +135836,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -135844,8 +136257,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135864,7 +136280,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -135872,6 +136287,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -135884,7 +136300,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -136046,8 +136462,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -136066,7 +136485,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -136074,6 +136492,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -136086,7 +136505,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -136577,8 +136996,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -136597,7 +137019,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -136605,6 +137026,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -136617,7 +137039,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -137058,8 +137480,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137078,7 +137503,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -137086,6 +137510,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -137098,7 +137523,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -137519,8 +137944,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137539,7 +137967,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -137547,6 +137974,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -137559,7 +137987,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -137983,8 +138411,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138003,7 +138434,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -138011,6 +138441,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -138023,7 +138454,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -138445,8 +138876,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138465,7 +138899,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -138473,6 +138906,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -138485,7 +138919,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -138905,8 +139339,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138925,7 +139362,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -138933,6 +139369,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -138945,7 +139382,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -139365,8 +139802,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -139385,7 +139825,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -139393,6 +139832,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -139405,7 +139845,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -139822,8 +140262,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -139842,7 +140285,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -139850,6 +140292,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -139862,7 +140305,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -140283,8 +140726,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -140303,7 +140749,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -140311,6 +140756,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -140323,7 +140769,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -140886,8 +141332,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -140906,7 +141355,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -140914,6 +141362,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -140926,7 +141375,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -141406,8 +141855,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -141426,7 +141878,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -141434,6 +141885,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -141446,7 +141898,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -141608,8 +142060,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -141628,7 +142083,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -141636,6 +142090,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -141648,7 +142103,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -142069,8 +142524,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142089,7 +142547,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -142097,6 +142554,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -142109,7 +142567,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -142271,8 +142729,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142291,7 +142752,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -142299,6 +142759,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -142311,7 +142772,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -149414,8 +149875,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -149434,7 +149898,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -149442,6 +149905,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -149454,7 +149918,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -149612,8 +150076,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -149632,7 +150099,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -149640,6 +150106,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -149652,7 +150119,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -150073,8 +150540,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150093,7 +150563,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -150101,6 +150570,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -150113,7 +150583,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -150275,8 +150745,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150295,7 +150768,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -150303,6 +150775,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -150315,7 +150788,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -150806,8 +151279,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150826,7 +151302,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -150834,6 +151309,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -150846,7 +151322,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -151287,8 +151763,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -151307,7 +151786,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -151315,6 +151793,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -151327,7 +151806,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -151748,8 +152227,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -151768,7 +152250,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -151776,6 +152257,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -151788,7 +152270,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -152212,8 +152694,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -152232,7 +152717,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -152240,6 +152724,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -152252,7 +152737,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -152674,8 +153159,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -152694,7 +153182,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -152702,6 +153189,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -152714,7 +153202,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -153134,8 +153622,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -153154,7 +153645,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -153162,6 +153652,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -153174,7 +153665,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -153594,8 +154085,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -153614,7 +154108,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -153622,6 +154115,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -153634,7 +154128,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -154051,8 +154545,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -154071,7 +154568,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -154079,6 +154575,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -154091,7 +154588,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -154512,8 +155009,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -154532,7 +155032,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -154540,6 +155039,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -154552,7 +155052,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -155115,8 +155615,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155135,7 +155638,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -155143,6 +155645,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -155155,7 +155658,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -155635,8 +156138,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155655,7 +156161,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -155663,6 +156168,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -155675,7 +156181,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -155837,8 +156343,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155857,7 +156366,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -155865,6 +156373,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -155877,7 +156386,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -156298,8 +156807,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156318,7 +156830,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -156326,6 +156837,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -156338,7 +156850,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -156500,8 +157012,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156520,7 +157035,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -156528,6 +157042,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -156540,7 +157055,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -162034,8 +162549,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -162054,7 +162572,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"describes\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -162062,6 +162579,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -162074,7 +162592,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -163834,8 +164352,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -163854,7 +164375,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"oneOf\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -163862,6 +164382,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -163874,7 +164395,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -164298,8 +164819,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -164318,7 +164842,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"anyOf\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -164326,6 +164849,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -164338,7 +164862,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -164788,8 +165312,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -164808,7 +165335,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quote\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -164816,6 +165342,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -164828,7 +165355,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -165269,8 +165796,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -165289,7 +165819,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quoteAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -165297,6 +165826,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -165309,7 +165839,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -168411,8 +168941,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -168431,7 +168964,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"subject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -168439,6 +168971,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -168451,7 +168984,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -168868,8 +169401,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -168888,7 +169424,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"object\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -168896,6 +169431,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -168908,7 +169444,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -169067,8 +169603,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169087,7 +169626,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"object\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -169095,6 +169633,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -169107,7 +169646,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -169527,8 +170066,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169547,7 +170089,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"relationship\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -169555,6 +170096,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -169567,7 +170109,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -169728,8 +170270,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169748,7 +170293,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"relationship\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -169756,6 +170300,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -169768,7 +170313,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -174325,8 +174870,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -174345,7 +174893,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -174353,6 +174900,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -174365,7 +174913,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -174523,8 +175071,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -174543,7 +175094,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -174551,6 +175101,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -174563,7 +175114,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -174984,8 +175535,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175004,7 +175558,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -175012,6 +175565,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -175024,7 +175578,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -175186,8 +175740,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175206,7 +175763,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -175214,6 +175770,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -175226,7 +175783,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -175717,8 +176274,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175737,7 +176297,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -175745,6 +176304,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -175757,7 +176317,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -176198,8 +176758,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -176218,7 +176781,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -176226,6 +176788,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -176238,7 +176801,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -176659,8 +177222,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -176679,7 +177245,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -176687,6 +177252,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -176699,7 +177265,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -177123,8 +177689,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -177143,7 +177712,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -177151,6 +177719,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -177163,7 +177732,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -177585,8 +178154,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -177605,7 +178177,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -177613,6 +178184,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -177625,7 +178197,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -178045,8 +178617,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178065,7 +178640,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -178073,6 +178647,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -178085,7 +178660,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -178505,8 +179080,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178525,7 +179103,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -178533,6 +179110,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -178545,7 +179123,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -178962,8 +179540,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178982,7 +179563,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -178990,6 +179570,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -179002,7 +179583,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -179423,8 +180004,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -179443,7 +180027,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -179451,6 +180034,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -179463,7 +180047,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -180026,8 +180610,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180046,7 +180633,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -180054,6 +180640,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -180066,7 +180653,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -180546,8 +181133,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180566,7 +181156,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -180574,6 +181163,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -180586,7 +181176,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -180748,8 +181338,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180768,7 +181361,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -180776,6 +181368,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -180788,7 +181381,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -181209,8 +181802,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181229,7 +181825,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -181237,6 +181832,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -181249,7 +181845,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -181411,8 +182007,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181431,7 +182030,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -181439,6 +182037,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -181451,7 +182050,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index e5e536156..cc77da37c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -432,12 +432,15 @@ function getCachedJsonLdContext(object: object, context: unknown): unknown { // Puts the document an embedded object was received as back into its cache, // after decoding it from the result of inheritJsonLdContext(): async function keepCachedJsonLd( - object: object, + object: unknown, document: object, decoded: object, contextLoader: DocumentLoader, ): Promise { - if (decoded === document) return; + // A preprocessor can turn the value into a scalar: + if (decoded === document || object == null || typeof object !== \\"object\\") { + return; + } const target = object as unknown as { _cachedJsonLd?: unknown }; const cached = target._cachedJsonLd; if (cached == null) return; @@ -545,19 +548,18 @@ const fixedCachedJsonLd = new WeakSet(); // Whether an embedded document under a key of the cached JSON-LD of an object // can be decoded again. Prepending a context cannot rebuild what a context // that does not propagate to embedded nodes, in the document or in the embedded -// document, or a property-scoped context for the key took part in: +// document, or a type-scoped or property-scoped context took part in: function canDecodeCachedJsonLd( object: object, context: unknown, embedded: object, - key: string, ): boolean { return !fixedCachedJsonLd.has(object) && !isNonPropagatingContext(context) && !isNonPropagatingContext( (embedded as { \\"@context\\"?: unknown })[\\"@context\\"], ) && - !hasPropertyScopedContext(context, key); + !hasScopedContext(context); } // Gives an object decoded with the whole document the document it was received @@ -574,14 +576,50 @@ function fixCachedJsonLd(object: unknown, document: object): void { fixedCachedJsonLd.add(object); } -function hasPropertyScopedContext(context: unknown, key: string): boolean { +function hasScopedContext(context: unknown): boolean { const entries = globalThis.Array.isArray(context) ? context : [context]; - return entries.some((entry) => { - const term = entry != null && typeof entry === \\"object\\" - ? (entry as Record)[key] - : undefined; - return term != null && typeof term === \\"object\\" && \\"@context\\" in term; - }); + return entries.some((entry) => + entry != null && typeof entry === \\"object\\" && + globalThis.Object.values(entry).some((term) => + term != null && typeof term === \\"object\\" && \\"@context\\" in term + ) + ); +} + +// Context loaders that load each URL once, keyed by the cached document whose +// embedded documents they decode and then by the wrapped loader. The documents +// can come from a remote peer, and decoding each of them with the parent's +// context must not multiply outbound requests by their number: +const sharedContextLoaders = new WeakMap< + object, + WeakMap +>(); + +function shareContextLoader( + document: object, + contextLoader: DocumentLoader, +): DocumentLoader { + let loaders = sharedContextLoaders.get(document); + if (loaders == null) { + loaders = new WeakMap(); + sharedContextLoaders.set(document, loaders); + } + let shared = loaders.get(contextLoader); + if (shared == null) { + const loads = new Map>(); + shared = (url, options) => { + let load = loads.get(url); + if (load == null) { + load = contextLoader(url, options); + loads.set(url, load); + // A failure is not remembered, so that a later call can try again: + load.catch(() => loads.delete(url)); + } + return load; + }; + loaders.set(contextLoader, shared); + } + return shared; } // Whether the embedded documents under a key of a compacted document are the @@ -6527,8 +6565,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -6547,7 +6588,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"attachment\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -6555,6 +6595,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -6567,7 +6608,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -7047,8 +7088,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7067,7 +7111,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"attributedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -7075,6 +7118,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7087,7 +7131,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -7248,8 +7292,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7268,7 +7315,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"attributedTo\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -7276,6 +7322,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7288,7 +7335,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -7707,8 +7754,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7727,7 +7777,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"audience\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -7735,6 +7784,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7747,7 +7797,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -7907,8 +7957,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7927,7 +7980,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"audience\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -7935,6 +7987,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7947,7 +8000,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -8419,8 +8472,11 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -8439,7 +8495,6 @@ get contents(): ((string | LanguageString))[] { this, context, obj, - \\"context\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -8447,6 +8502,7 @@ get contents(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -8459,7 +8515,7 @@ get contents(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -8938,8 +8994,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -8958,7 +9017,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"generator\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -8966,6 +9024,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -8978,7 +9037,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -9420,8 +9479,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9440,7 +9502,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"icon\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -9448,6 +9509,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -9460,7 +9522,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -9621,8 +9683,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9641,7 +9706,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"icon\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -9649,6 +9713,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -9661,7 +9726,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -10103,8 +10168,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10123,7 +10191,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"image\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -10131,6 +10198,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -10143,7 +10211,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -10304,8 +10372,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10324,7 +10395,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"image\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -10332,6 +10402,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -10344,7 +10415,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -10778,8 +10849,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10798,7 +10872,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"inReplyTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -10806,6 +10879,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -10818,7 +10892,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -10978,8 +11052,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10998,7 +11075,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"inReplyTo\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -11006,6 +11082,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -11018,7 +11095,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -11452,8 +11529,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11472,7 +11552,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"location\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -11480,6 +11559,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -11492,7 +11572,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -11652,8 +11732,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11672,7 +11755,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"location\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -11680,6 +11762,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -11692,7 +11775,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -12125,8 +12208,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12145,7 +12231,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"preview\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -12153,6 +12238,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -12165,7 +12251,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -12324,8 +12410,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12344,7 +12433,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"preview\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -12352,6 +12440,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -12364,7 +12453,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -12796,8 +12885,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12816,7 +12908,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"replies\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -12824,6 +12915,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -12836,7 +12928,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -13260,8 +13352,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -13280,7 +13375,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"shares\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -13288,6 +13382,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -13300,7 +13395,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -13724,8 +13819,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -13744,7 +13842,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"likes\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -13752,6 +13849,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -13764,7 +13862,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -14182,8 +14280,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -14202,7 +14303,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - \\"emojiReactions\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -14210,6 +14310,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -14222,7 +14323,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -14701,8 +14802,11 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -14721,7 +14825,6 @@ get summaries(): ((string | LanguageString))[] { this, context, obj, - \\"tag\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -14729,6 +14832,7 @@ get summaries(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -14741,7 +14845,7 @@ get summaries(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -15194,8 +15298,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15214,7 +15321,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"to\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -15222,6 +15328,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -15234,7 +15341,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -15394,8 +15501,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15414,7 +15524,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"to\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -15422,6 +15531,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -15434,7 +15544,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -15853,8 +15963,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15873,7 +15986,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"bto\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -15881,6 +15993,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -15893,7 +16006,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -16053,8 +16166,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16073,7 +16189,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"bto\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -16081,6 +16196,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -16093,7 +16209,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -16512,8 +16628,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16532,7 +16651,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"cc\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -16540,6 +16658,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -16552,7 +16671,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -16712,8 +16831,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16732,7 +16854,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"cc\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -16740,6 +16861,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -16752,7 +16874,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -17171,8 +17293,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17191,7 +17316,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"bcc\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -17199,6 +17323,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -17211,7 +17336,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -17371,8 +17496,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17391,7 +17519,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"bcc\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -17399,6 +17526,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -17411,7 +17539,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -17893,8 +18021,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17913,7 +18044,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"proof\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -17921,6 +18051,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -17933,7 +18064,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -18092,8 +18223,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18112,7 +18246,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - \\"proof\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -18120,6 +18253,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -18132,7 +18266,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -18590,8 +18724,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18610,7 +18747,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"likeAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -18618,6 +18754,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -18630,7 +18767,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -19048,8 +19185,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -19068,7 +19208,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"replyAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -19076,6 +19215,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -19088,7 +19228,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -19506,8 +19646,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -19526,7 +19669,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - \\"announceAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -19534,6 +19676,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -19546,7 +19689,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -26091,8 +26234,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -26111,7 +26257,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quote\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -26119,6 +26264,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -26131,7 +26277,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -26572,8 +26718,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -26592,7 +26741,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quoteAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -26600,6 +26748,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -26612,7 +26761,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -29121,8 +29270,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29141,7 +29293,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"actor\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -29149,6 +29300,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -29161,7 +29313,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -29322,8 +29474,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29342,7 +29497,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"actor\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -29350,6 +29504,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -29362,7 +29517,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -29782,8 +29937,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29802,7 +29960,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"object\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -29810,6 +29967,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -29822,7 +29980,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -29983,8 +30141,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30003,7 +30164,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"object\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -30011,6 +30171,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -30023,7 +30184,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -30446,8 +30607,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30466,7 +30630,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"target\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -30474,6 +30637,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -30486,7 +30650,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -30650,8 +30814,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30670,7 +30837,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"target\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -30678,6 +30844,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -30690,7 +30857,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -31110,8 +31277,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31130,7 +31300,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"result\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -31138,6 +31307,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -31150,7 +31320,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -31311,8 +31481,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31331,7 +31504,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"result\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -31339,6 +31511,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -31351,7 +31524,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -31772,8 +31945,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31792,7 +31968,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"origin\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -31800,6 +31975,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -31812,7 +31988,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -31974,8 +32150,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31994,7 +32173,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"origin\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -32002,6 +32180,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -32014,7 +32193,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -32433,8 +32612,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32453,7 +32635,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"instrument\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -32461,6 +32642,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -32473,7 +32655,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -32633,8 +32815,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32653,7 +32838,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"instrument\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -32661,6 +32845,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -32673,7 +32858,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -37000,8 +37185,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -37020,7 +37208,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -37028,6 +37215,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -37040,7 +37228,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -37457,8 +37645,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -37477,7 +37668,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -37485,6 +37675,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -37497,7 +37688,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -42107,8 +42298,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -42127,7 +42321,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -42135,6 +42328,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -42147,7 +42341,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -42564,8 +42758,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -42584,7 +42781,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -42592,6 +42788,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -42604,7 +42801,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -44517,8 +44714,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -44537,7 +44737,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -44545,6 +44744,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -44557,7 +44757,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -44974,8 +45174,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -44994,7 +45197,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -45002,6 +45204,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -45014,7 +45217,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -46926,8 +47129,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -46946,7 +47152,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -46954,6 +47159,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -46966,7 +47172,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -47383,8 +47589,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -47403,7 +47612,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -47411,6 +47619,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -47423,7 +47632,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -49973,8 +50182,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -49993,7 +50205,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"translator\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -50001,6 +50212,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -50013,7 +50225,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -50177,8 +50389,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -50197,7 +50412,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"translator\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -50205,6 +50419,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -50217,7 +50432,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -52062,8 +52277,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -52082,7 +52300,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactingObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -52090,6 +52307,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -52102,7 +52320,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -52518,8 +52736,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -52538,7 +52759,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"interactionTarget\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -52546,6 +52766,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -52558,7 +52779,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -55459,8 +55680,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -55479,7 +55703,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"current\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -55487,6 +55710,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -55499,7 +55723,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -55917,8 +56141,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -55937,7 +56164,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"first\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -55945,6 +56171,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -55957,7 +56184,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -56375,8 +56602,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -56395,7 +56625,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"last\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -56403,6 +56632,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -56415,7 +56645,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -56852,8 +57082,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -56872,7 +57105,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"items\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -56880,6 +57112,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -56892,7 +57125,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -57310,8 +57543,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -57330,7 +57566,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"likesOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -57338,6 +57573,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -57350,7 +57586,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -57767,8 +58003,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -57787,7 +58026,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"sharesOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -57795,6 +58033,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -57807,7 +58046,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -58224,8 +58463,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58244,7 +58486,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"repliesOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -58252,6 +58493,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -58264,7 +58506,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -58681,8 +58923,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58701,7 +58946,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"inboxOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -58709,6 +58953,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -58721,7 +58966,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -59138,8 +59383,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -59158,7 +59406,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"outboxOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -59166,6 +59413,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -59178,7 +59426,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -59595,8 +59843,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -59615,7 +59866,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"followersOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -59623,6 +59873,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -59635,7 +59886,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -60052,8 +60303,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -60072,7 +60326,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"followingOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -60080,6 +60333,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -60092,7 +60346,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -60509,8 +60763,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -60529,7 +60786,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"likedOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -60537,6 +60793,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -60549,7 +60806,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -63142,8 +63399,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -63162,7 +63422,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"orderedItems\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -63170,6 +63429,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -63182,7 +63442,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -65364,8 +65624,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -65384,7 +65647,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"featuredObject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -65392,6 +65654,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -65404,7 +65667,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -65822,8 +66085,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -65842,7 +66108,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"featureAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -65850,6 +66115,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -65862,7 +66128,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -70468,8 +70734,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -70488,7 +70757,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"owner\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -70496,6 +70764,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -70508,7 +70777,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -72045,8 +72314,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -72065,7 +72337,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"controller\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -72073,6 +72344,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -72085,7 +72357,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -82406,8 +82678,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -82426,7 +82701,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -82434,6 +82708,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -82446,7 +82721,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -82604,8 +82879,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -82624,7 +82902,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -82632,6 +82909,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -82644,7 +82922,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -83065,8 +83343,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83085,7 +83366,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -83093,6 +83373,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -83105,7 +83386,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -83267,8 +83548,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83287,7 +83571,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -83295,6 +83578,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -83307,7 +83591,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -83798,8 +84082,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83818,7 +84105,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -83826,6 +84112,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -83838,7 +84125,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -84279,8 +84566,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -84299,7 +84589,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -84307,6 +84596,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -84319,7 +84609,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -84740,8 +85030,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -84760,7 +85053,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -84768,6 +85060,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -84780,7 +85073,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -85204,8 +85497,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85224,7 +85520,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -85232,6 +85527,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -85244,7 +85540,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -85666,8 +85962,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85686,7 +85985,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -85694,6 +85992,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -85706,7 +86005,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -86126,8 +86425,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -86146,7 +86448,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -86154,6 +86455,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -86166,7 +86468,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -86586,8 +86888,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -86606,7 +86911,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -86614,6 +86918,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -86626,7 +86931,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -87043,8 +87348,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -87063,7 +87371,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -87071,6 +87378,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -87083,7 +87391,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -87504,8 +87812,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -87524,7 +87835,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -87532,6 +87842,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -87544,7 +87855,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -88107,8 +88418,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88127,7 +88441,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -88135,6 +88448,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -88147,7 +88461,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -88627,8 +88941,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88647,7 +88964,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -88655,6 +88971,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -88667,7 +88984,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -88829,8 +89146,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88849,7 +89169,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -88857,6 +89176,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -88869,7 +89189,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -89290,8 +89610,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89310,7 +89633,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -89318,6 +89640,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -89330,7 +89653,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -89492,8 +89815,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89512,7 +89838,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -89520,6 +89845,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -89532,7 +89858,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -94730,8 +95056,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -94750,7 +95079,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quote\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -94758,6 +95086,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -94770,7 +95099,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -95211,8 +95540,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -95231,7 +95563,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quoteAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -95239,6 +95570,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -95251,7 +95583,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -99464,8 +99796,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -99484,7 +99819,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"partOf\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -99492,6 +99826,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -99504,7 +99839,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -99920,8 +100255,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -99940,7 +100278,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"next\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -99948,6 +100285,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -99960,7 +100298,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -100377,8 +100715,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -100397,7 +100738,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"prev\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -100405,6 +100745,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -100417,7 +100758,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -109522,8 +109863,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -109542,7 +109886,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -109550,6 +109893,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -109562,7 +109906,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -109720,8 +110064,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -109740,7 +110087,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -109748,6 +110094,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -109760,7 +110107,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -110181,8 +110528,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110201,7 +110551,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -110209,6 +110558,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -110221,7 +110571,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -110383,8 +110733,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110403,7 +110756,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -110411,6 +110763,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -110423,7 +110776,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -110914,8 +111267,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110934,7 +111290,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -110942,6 +111297,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -110954,7 +111310,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -111395,8 +111751,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -111415,7 +111774,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -111423,6 +111781,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -111435,7 +111794,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -111856,8 +112215,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -111876,7 +112238,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -111884,6 +112245,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -111896,7 +112258,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -112320,8 +112682,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -112340,7 +112705,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -112348,6 +112712,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -112360,7 +112725,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -112782,8 +113147,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -112802,7 +113170,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -112810,6 +113177,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -112822,7 +113190,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -113242,8 +113610,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -113262,7 +113633,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -113270,6 +113640,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -113282,7 +113653,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -113702,8 +114073,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -113722,7 +114096,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -113730,6 +114103,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -113742,7 +114116,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -114159,8 +114533,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -114179,7 +114556,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -114187,6 +114563,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -114199,7 +114576,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -114620,8 +114997,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -114640,7 +115020,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -114648,6 +115027,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -114660,7 +115040,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -115223,8 +115603,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115243,7 +115626,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -115251,6 +115633,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -115263,7 +115646,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -115743,8 +116126,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115763,7 +116149,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -115771,6 +116156,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -115783,7 +116169,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -115945,8 +116331,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115965,7 +116354,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -115973,6 +116361,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -115985,7 +116374,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -116406,8 +116795,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116426,7 +116818,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -116434,6 +116825,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -116446,7 +116838,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -116608,8 +117000,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116628,7 +117023,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -116636,6 +117030,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -116648,7 +117043,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -121702,8 +122097,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -121722,7 +122120,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - \\"preview\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -121730,6 +122127,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -121742,7 +122140,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -129187,8 +129585,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -129207,7 +129608,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quote\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -129215,6 +129615,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -129227,7 +129628,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -129668,8 +130069,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -129688,7 +130092,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quoteAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -129696,6 +130099,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -129708,7 +130112,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -131233,8 +131637,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -131253,7 +131660,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"orderedItems\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -131261,6 +131667,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -131273,7 +131680,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -135183,8 +135590,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135203,7 +135613,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -135211,6 +135620,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -135223,7 +135633,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -135381,8 +135791,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135401,7 +135814,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -135409,6 +135821,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -135421,7 +135834,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -135842,8 +136255,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135862,7 +136278,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -135870,6 +136285,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -135882,7 +136298,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -136044,8 +136460,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -136064,7 +136483,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -136072,6 +136490,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -136084,7 +136503,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -136575,8 +136994,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -136595,7 +137017,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -136603,6 +137024,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -136615,7 +137037,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -137056,8 +137478,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137076,7 +137501,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -137084,6 +137508,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -137096,7 +137521,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -137517,8 +137942,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137537,7 +137965,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -137545,6 +137972,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -137557,7 +137985,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -137981,8 +138409,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138001,7 +138432,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -138009,6 +138439,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -138021,7 +138452,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -138443,8 +138874,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138463,7 +138897,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -138471,6 +138904,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -138483,7 +138917,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -138903,8 +139337,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138923,7 +139360,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -138931,6 +139367,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -138943,7 +139380,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -139363,8 +139800,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -139383,7 +139823,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -139391,6 +139830,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -139403,7 +139843,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -139820,8 +140260,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -139840,7 +140283,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -139848,6 +140290,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -139860,7 +140303,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -140281,8 +140724,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -140301,7 +140747,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -140309,6 +140754,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -140321,7 +140767,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -140884,8 +141330,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -140904,7 +141353,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -140912,6 +141360,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -140924,7 +141373,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -141404,8 +141853,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -141424,7 +141876,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -141432,6 +141883,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -141444,7 +141896,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -141606,8 +142058,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -141626,7 +142081,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -141634,6 +142088,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -141646,7 +142101,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -142067,8 +142522,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142087,7 +142545,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -142095,6 +142552,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -142107,7 +142565,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -142269,8 +142727,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142289,7 +142750,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -142297,6 +142757,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -142309,7 +142770,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -149412,8 +149873,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -149432,7 +149896,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -149440,6 +149903,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -149452,7 +149916,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -149610,8 +150074,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -149630,7 +150097,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -149638,6 +150104,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -149650,7 +150117,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -150071,8 +150538,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150091,7 +150561,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -150099,6 +150568,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -150111,7 +150581,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -150273,8 +150743,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150293,7 +150766,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -150301,6 +150773,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -150313,7 +150786,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -150804,8 +151277,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150824,7 +151300,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -150832,6 +151307,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -150844,7 +151320,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -151285,8 +151761,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -151305,7 +151784,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -151313,6 +151791,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -151325,7 +151804,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -151746,8 +152225,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -151766,7 +152248,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -151774,6 +152255,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -151786,7 +152268,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -152210,8 +152692,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -152230,7 +152715,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -152238,6 +152722,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -152250,7 +152735,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -152672,8 +153157,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -152692,7 +153180,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -152700,6 +153187,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -152712,7 +153200,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -153132,8 +153620,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -153152,7 +153643,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -153160,6 +153650,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -153172,7 +153663,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -153592,8 +154083,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -153612,7 +154106,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -153620,6 +154113,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -153632,7 +154126,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -154049,8 +154543,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -154069,7 +154566,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -154077,6 +154573,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -154089,7 +154586,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -154510,8 +155007,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -154530,7 +155030,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -154538,6 +155037,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -154550,7 +155050,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -155113,8 +155613,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155133,7 +155636,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -155141,6 +155643,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -155153,7 +155656,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -155633,8 +156136,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155653,7 +156159,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -155661,6 +156166,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -155673,7 +156179,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -155835,8 +156341,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155855,7 +156364,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -155863,6 +156371,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -155875,7 +156384,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -156296,8 +156805,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156316,7 +156828,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -156324,6 +156835,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -156336,7 +156848,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -156498,8 +157010,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156518,7 +157033,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -156526,6 +157040,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -156538,7 +157053,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -162032,8 +162547,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -162052,7 +162570,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"describes\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -162060,6 +162577,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -162072,7 +162590,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -163832,8 +164350,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -163852,7 +164373,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"oneOf\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -163860,6 +164380,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -163872,7 +164393,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -164296,8 +164817,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -164316,7 +164840,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"anyOf\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -164324,6 +164847,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -164336,7 +164860,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -164786,8 +165310,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -164806,7 +165333,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quote\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -164814,6 +165340,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -164826,7 +165353,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -165267,8 +165794,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -165287,7 +165817,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"quoteAuthorization\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -165295,6 +165824,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -165307,7 +165837,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -168409,8 +168939,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -168429,7 +168962,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"subject\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -168437,6 +168969,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -168449,7 +168982,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -168866,8 +169399,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -168886,7 +169422,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"object\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -168894,6 +169429,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -168906,7 +169442,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -169065,8 +169601,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169085,7 +169624,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"object\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -169093,6 +169631,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -169105,7 +169644,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -169525,8 +170064,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169545,7 +170087,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - \\"relationship\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -169553,6 +170094,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -169565,7 +170107,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -169726,8 +170268,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169746,7 +170291,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - \\"relationship\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -169754,6 +170298,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -169766,7 +170311,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -174323,8 +174868,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -174343,7 +174891,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -174351,6 +174898,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -174363,7 +174911,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -174521,8 +175069,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -174541,7 +175092,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"publicKey\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -174549,6 +175099,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -174561,7 +175112,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -174982,8 +175533,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175002,7 +175556,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -175010,6 +175563,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -175022,7 +175576,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -175184,8 +175738,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175204,7 +175761,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - \\"assertionMethod\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -175212,6 +175768,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -175224,7 +175781,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -175715,8 +176272,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175735,7 +176295,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"inbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -175743,6 +176302,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -175755,7 +176315,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -176196,8 +176756,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -176216,7 +176779,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"outbox\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -176224,6 +176786,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -176236,7 +176799,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -176657,8 +177220,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -176677,7 +177243,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"following\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -176685,6 +177250,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -176697,7 +177263,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -177121,8 +177687,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -177141,7 +177710,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"followers\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -177149,6 +177717,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -177161,7 +177730,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -177583,8 +178152,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -177603,7 +178175,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"liked\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -177611,6 +178182,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -177623,7 +178195,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -178043,8 +178615,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178063,7 +178638,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featured\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -178071,6 +178645,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -178083,7 +178658,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -178503,8 +179078,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178523,7 +179101,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredTags\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -178531,6 +179108,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -178543,7 +179121,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -178960,8 +179538,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178980,7 +179561,6 @@ get gateways(): (URL)[] { this, context, doc, - \\"featuredCollections\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -178988,6 +179568,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -179000,7 +179581,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -179421,8 +180002,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -179441,7 +180025,6 @@ get gateways(): (URL)[] { this, context, obj, - \\"streams\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -179449,6 +180032,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -179461,7 +180045,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -180024,8 +180608,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180044,7 +180631,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"movedTo\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -180052,6 +180638,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -180064,7 +180651,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -180544,8 +181131,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180564,7 +181154,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -180572,6 +181161,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -180584,7 +181174,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -180746,8 +181336,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180766,7 +181359,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"alsoKnownAs\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -180774,6 +181366,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -180786,7 +181379,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -181207,8 +181800,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181227,7 +181823,6 @@ get attributionDomains(): (string)[] { this, context, doc, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -181235,6 +181830,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -181247,7 +181843,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -181409,8 +182005,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181429,7 +182028,6 @@ get attributionDomains(): (string)[] { this, context, obj, - \\"service\\", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -181437,6 +182035,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -181449,7 +182048,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 3c23d2465..0f7436f1e 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -434,12 +434,15 @@ function getCachedJsonLdContext(object: object, context: unknown): unknown { // Puts the document an embedded object was received as back into its cache, // after decoding it from the result of inheritJsonLdContext(): async function keepCachedJsonLd( - object: object, + object: unknown, document: object, decoded: object, contextLoader: DocumentLoader, ): Promise { - if (decoded === document) return; + // A preprocessor can turn the value into a scalar: + if (decoded === document || object == null || typeof object !== "object") { + return; + } const target = object as unknown as { _cachedJsonLd?: unknown }; const cached = target._cachedJsonLd; if (cached == null) return; @@ -547,19 +550,18 @@ const fixedCachedJsonLd = new WeakSet(); // Whether an embedded document under a key of the cached JSON-LD of an object // can be decoded again. Prepending a context cannot rebuild what a context // that does not propagate to embedded nodes, in the document or in the embedded -// document, or a property-scoped context for the key took part in: +// document, or a type-scoped or property-scoped context took part in: function canDecodeCachedJsonLd( object: object, context: unknown, embedded: object, - key: string, ): boolean { return !fixedCachedJsonLd.has(object) && !isNonPropagatingContext(context) && !isNonPropagatingContext( (embedded as { "@context"?: unknown })["@context"], ) && - !hasPropertyScopedContext(context, key); + !hasScopedContext(context); } // Gives an object decoded with the whole document the document it was received @@ -576,14 +578,50 @@ function fixCachedJsonLd(object: unknown, document: object): void { fixedCachedJsonLd.add(object); } -function hasPropertyScopedContext(context: unknown, key: string): boolean { +function hasScopedContext(context: unknown): boolean { const entries = globalThis.Array.isArray(context) ? context : [context]; - return entries.some((entry) => { - const term = entry != null && typeof entry === "object" - ? (entry as Record)[key] - : undefined; - return term != null && typeof term === "object" && "@context" in term; - }); + return entries.some((entry) => + entry != null && typeof entry === "object" && + globalThis.Object.values(entry).some((term) => + term != null && typeof term === "object" && "@context" in term + ) + ); +} + +// Context loaders that load each URL once, keyed by the cached document whose +// embedded documents they decode and then by the wrapped loader. The documents +// can come from a remote peer, and decoding each of them with the parent's +// context must not multiply outbound requests by their number: +const sharedContextLoaders = new WeakMap< + object, + WeakMap +>(); + +function shareContextLoader( + document: object, + contextLoader: DocumentLoader, +): DocumentLoader { + let loaders = sharedContextLoaders.get(document); + if (loaders == null) { + loaders = new WeakMap(); + sharedContextLoaders.set(document, loaders); + } + let shared = loaders.get(contextLoader); + if (shared == null) { + const loads = new Map>(); + shared = (url, options) => { + let load = loads.get(url); + if (load == null) { + load = contextLoader(url, options); + loads.set(url, load); + // A failure is not remembered, so that a later call can try again: + load.catch(() => loads.delete(url)); + } + return load; + }; + loaders.set(contextLoader, shared); + } + return shared; } // Whether the embedded documents under a key of a compacted document are the @@ -6529,8 +6567,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -6549,7 +6590,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "attachment", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -6557,6 +6597,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -6569,7 +6610,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -7049,8 +7090,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -7069,7 +7113,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "attributedTo", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -7077,6 +7120,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7089,7 +7133,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -7250,8 +7294,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -7270,7 +7317,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "attributedTo", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -7278,6 +7324,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7290,7 +7337,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -7709,8 +7756,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -7729,7 +7779,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "audience", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -7737,6 +7786,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7749,7 +7799,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -7909,8 +7959,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -7929,7 +7982,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "audience", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -7937,6 +7989,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -7949,7 +8002,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -8421,8 +8474,11 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -8441,7 +8497,6 @@ get contents(): ((string | LanguageString))[] { this, context, obj, - "context", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -8449,6 +8504,7 @@ get contents(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -8461,7 +8517,7 @@ get contents(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -8940,8 +8996,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -8960,7 +9019,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - "generator", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -8968,6 +9026,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -8980,7 +9039,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -9422,8 +9481,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -9442,7 +9504,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - "icon", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -9450,6 +9511,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -9462,7 +9524,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -9623,8 +9685,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -9643,7 +9708,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - "icon", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -9651,6 +9715,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -9663,7 +9728,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -10105,8 +10170,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -10125,7 +10193,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - "image", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -10133,6 +10200,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -10145,7 +10213,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -10306,8 +10374,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -10326,7 +10397,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - "image", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -10334,6 +10404,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -10346,7 +10417,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -10780,8 +10851,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -10800,7 +10874,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - "inReplyTo", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -10808,6 +10881,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -10820,7 +10894,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -10980,8 +11054,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -11000,7 +11077,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - "inReplyTo", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -11008,6 +11084,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -11020,7 +11097,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -11454,8 +11531,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -11474,7 +11554,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - "location", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -11482,6 +11561,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -11494,7 +11574,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -11654,8 +11734,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -11674,7 +11757,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - "location", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -11682,6 +11764,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -11694,7 +11777,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -12127,8 +12210,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -12147,7 +12233,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - "preview", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -12155,6 +12240,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -12167,7 +12253,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -12326,8 +12412,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -12346,7 +12435,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - "preview", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -12354,6 +12442,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -12366,7 +12455,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -12798,8 +12887,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -12818,7 +12910,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - "replies", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -12826,6 +12917,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -12838,7 +12930,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -13262,8 +13354,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -13282,7 +13377,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - "shares", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -13290,6 +13384,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -13302,7 +13397,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -13726,8 +13821,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -13746,7 +13844,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - "likes", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -13754,6 +13851,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -13766,7 +13864,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -14184,8 +14282,11 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -14204,7 +14305,6 @@ get names(): ((string | LanguageString))[] { this, context, doc, - "emojiReactions", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -14212,6 +14312,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -14224,7 +14325,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -14703,8 +14804,11 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -14723,7 +14827,6 @@ get summaries(): ((string | LanguageString))[] { this, context, obj, - "tag", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -14731,6 +14834,7 @@ get summaries(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -14743,7 +14847,7 @@ get summaries(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -15196,8 +15300,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -15216,7 +15323,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - "to", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -15224,6 +15330,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -15236,7 +15343,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -15396,8 +15503,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -15416,7 +15526,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - "to", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -15424,6 +15533,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -15436,7 +15546,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -15855,8 +15965,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -15875,7 +15988,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - "bto", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -15883,6 +15995,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -15895,7 +16008,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -16055,8 +16168,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -16075,7 +16191,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - "bto", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -16083,6 +16198,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -16095,7 +16211,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -16514,8 +16630,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -16534,7 +16653,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - "cc", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -16542,6 +16660,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -16554,7 +16673,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -16714,8 +16833,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -16734,7 +16856,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - "cc", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -16742,6 +16863,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -16754,7 +16876,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -17173,8 +17295,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -17193,7 +17318,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - "bcc", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -17201,6 +17325,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -17213,7 +17338,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -17373,8 +17498,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -17393,7 +17521,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - "bcc", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -17401,6 +17528,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -17413,7 +17541,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -17895,8 +18023,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -17915,7 +18046,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - "proof", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -17923,6 +18053,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -17935,7 +18066,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -18094,8 +18225,11 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -18114,7 +18248,6 @@ get urls(): ((URL | Link))[] { this, context, obj, - "proof", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -18122,6 +18255,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -18134,7 +18268,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -18592,8 +18726,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -18612,7 +18749,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - "likeAuthorization", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -18620,6 +18756,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -18632,7 +18769,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -19050,8 +19187,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -19070,7 +19210,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - "replyAuthorization", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -19078,6 +19217,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -19090,7 +19230,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -19508,8 +19648,11 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -19528,7 +19671,6 @@ get urls(): ((URL | Link))[] { this, context, doc, - "announceAuthorization", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -19536,6 +19678,7 @@ get urls(): ((URL | Link))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -19548,7 +19691,7 @@ get urls(): ((URL | Link))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -26093,8 +26236,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -26113,7 +26259,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "quote", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -26121,6 +26266,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -26133,7 +26279,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -26574,8 +26720,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -26594,7 +26743,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "quoteAuthorization", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -26602,6 +26750,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -26614,7 +26763,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -29123,8 +29272,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -29143,7 +29295,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "actor", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -29151,6 +29302,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -29163,7 +29315,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -29324,8 +29476,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -29344,7 +29499,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "actor", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -29352,6 +29506,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -29364,7 +29519,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -29784,8 +29939,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -29804,7 +29962,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "object", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -29812,6 +29969,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -29824,7 +29982,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -29985,8 +30143,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -30005,7 +30166,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "object", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -30013,6 +30173,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -30025,7 +30186,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -30448,8 +30609,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -30468,7 +30632,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "target", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -30476,6 +30639,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -30488,7 +30652,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -30652,8 +30816,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -30672,7 +30839,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "target", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -30680,6 +30846,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -30692,7 +30859,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -31112,8 +31279,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -31132,7 +31302,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "result", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -31140,6 +31309,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -31152,7 +31322,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -31313,8 +31483,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -31333,7 +31506,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "result", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -31341,6 +31513,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -31353,7 +31526,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -31774,8 +31947,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -31794,7 +31970,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "origin", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -31802,6 +31977,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -31814,7 +31990,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -31976,8 +32152,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -31996,7 +32175,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "origin", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -32004,6 +32182,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -32016,7 +32195,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -32435,8 +32614,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -32455,7 +32637,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "instrument", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -32463,6 +32644,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -32475,7 +32657,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -32635,8 +32817,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -32655,7 +32840,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "instrument", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -32663,6 +32847,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -32675,7 +32860,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -37002,8 +37187,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -37022,7 +37210,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactingObject", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -37030,6 +37217,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -37042,7 +37230,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -37459,8 +37647,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -37479,7 +37670,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactionTarget", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -37487,6 +37677,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -37499,7 +37690,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -42109,8 +42300,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -42129,7 +42323,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactingObject", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -42137,6 +42330,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -42149,7 +42343,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -42566,8 +42760,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -42586,7 +42783,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactionTarget", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -42594,6 +42790,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -42606,7 +42803,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -44519,8 +44716,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -44539,7 +44739,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactingObject", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -44547,6 +44746,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -44559,7 +44759,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -44976,8 +45176,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -44996,7 +45199,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactionTarget", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -45004,6 +45206,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -45016,7 +45219,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -46928,8 +47131,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -46948,7 +47154,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactingObject", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -46956,6 +47161,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -46968,7 +47174,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -47385,8 +47591,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -47405,7 +47614,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactionTarget", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -47413,6 +47621,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -47425,7 +47634,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -49975,8 +50184,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -49995,7 +50207,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "translator", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -50003,6 +50214,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -50015,7 +50227,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -50179,8 +50391,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -50199,7 +50414,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "translator", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -50207,6 +50421,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -50219,7 +50434,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -52064,8 +52279,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -52084,7 +52302,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactingObject", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -52092,6 +52309,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -52104,7 +52322,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -52520,8 +52738,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -52540,7 +52761,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "interactionTarget", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -52548,6 +52768,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -52560,7 +52781,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -55461,8 +55682,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -55481,7 +55705,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "current", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -55489,6 +55712,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -55501,7 +55725,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -55919,8 +56143,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -55939,7 +56166,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "first", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -55947,6 +56173,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -55959,7 +56186,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -56377,8 +56604,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -56397,7 +56627,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "last", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -56405,6 +56634,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -56417,7 +56647,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -56854,8 +57084,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -56874,7 +57107,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "items", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -56882,6 +57114,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -56894,7 +57127,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -57312,8 +57545,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -57332,7 +57568,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "likesOf", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -57340,6 +57575,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -57352,7 +57588,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -57769,8 +58005,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -57789,7 +58028,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "sharesOf", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -57797,6 +58035,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -57809,7 +58048,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -58226,8 +58465,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -58246,7 +58488,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "repliesOf", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -58254,6 +58495,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -58266,7 +58508,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -58683,8 +58925,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -58703,7 +58948,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "inboxOf", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -58711,6 +58955,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -58723,7 +58968,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -59140,8 +59385,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -59160,7 +59408,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "outboxOf", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -59168,6 +59415,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -59180,7 +59428,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -59597,8 +59845,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -59617,7 +59868,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "followersOf", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -59625,6 +59875,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -59637,7 +59888,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -60054,8 +60305,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -60074,7 +60328,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "followingOf", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -60082,6 +60335,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -60094,7 +60348,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -60511,8 +60765,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -60531,7 +60788,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "likedOf", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -60539,6 +60795,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -60551,7 +60808,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -63144,8 +63401,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -63164,7 +63424,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "orderedItems", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -63172,6 +63431,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -63184,7 +63444,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -65366,8 +65626,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -65386,7 +65649,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "featuredObject", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -65394,6 +65656,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -65406,7 +65669,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -65824,8 +66087,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -65844,7 +66110,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "featureAuthorization", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -65852,6 +66117,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -65864,7 +66130,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -70470,8 +70736,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -70490,7 +70759,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "owner", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -70498,6 +70766,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -70510,7 +70779,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -72047,8 +72316,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -72067,7 +72339,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "controller", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -72075,6 +72346,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -72087,7 +72359,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -82408,8 +82680,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -82428,7 +82703,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -82436,6 +82710,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -82448,7 +82723,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -82606,8 +82881,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -82626,7 +82904,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -82634,6 +82911,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -82646,7 +82924,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -83067,8 +83345,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -83087,7 +83368,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -83095,6 +83375,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -83107,7 +83388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -83269,8 +83550,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -83289,7 +83573,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -83297,6 +83580,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -83309,7 +83593,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -83800,8 +84084,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -83820,7 +84107,6 @@ get gateways(): (URL)[] { this, context, doc, - "inbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -83828,6 +84114,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -83840,7 +84127,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -84281,8 +84568,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -84301,7 +84591,6 @@ get gateways(): (URL)[] { this, context, doc, - "outbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -84309,6 +84598,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -84321,7 +84611,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -84742,8 +85032,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -84762,7 +85055,6 @@ get gateways(): (URL)[] { this, context, doc, - "following", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -84770,6 +85062,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -84782,7 +85075,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -85206,8 +85499,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -85226,7 +85522,6 @@ get gateways(): (URL)[] { this, context, doc, - "followers", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -85234,6 +85529,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -85246,7 +85542,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -85668,8 +85964,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -85688,7 +85987,6 @@ get gateways(): (URL)[] { this, context, doc, - "liked", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -85696,6 +85994,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -85708,7 +86007,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -86128,8 +86427,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -86148,7 +86450,6 @@ get gateways(): (URL)[] { this, context, doc, - "featured", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -86156,6 +86457,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -86168,7 +86470,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -86588,8 +86890,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -86608,7 +86913,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredTags", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -86616,6 +86920,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -86628,7 +86933,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -87045,8 +87350,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -87065,7 +87373,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredCollections", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -87073,6 +87380,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -87085,7 +87393,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -87506,8 +87814,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -87526,7 +87837,6 @@ get gateways(): (URL)[] { this, context, obj, - "streams", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -87534,6 +87844,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -87546,7 +87857,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -88109,8 +88420,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -88129,7 +88443,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "movedTo", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -88137,6 +88450,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -88149,7 +88463,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -88629,8 +88943,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -88649,7 +88966,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -88657,6 +88973,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -88669,7 +88986,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -88831,8 +89148,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -88851,7 +89171,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -88859,6 +89178,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -88871,7 +89191,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -89292,8 +89612,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -89312,7 +89635,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "service", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -89320,6 +89642,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -89332,7 +89655,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -89494,8 +89817,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -89514,7 +89840,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "service", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -89522,6 +89847,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -89534,7 +89860,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -94732,8 +95058,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -94752,7 +95081,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "quote", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -94760,6 +95088,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -94772,7 +95101,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -95213,8 +95542,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -95233,7 +95565,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "quoteAuthorization", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -95241,6 +95572,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -95253,7 +95585,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -99466,8 +99798,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -99486,7 +99821,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "partOf", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -99494,6 +99828,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -99506,7 +99841,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -99922,8 +100257,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -99942,7 +100280,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "next", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -99950,6 +100287,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -99962,7 +100300,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -100379,8 +100717,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -100399,7 +100740,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "prev", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -100407,6 +100747,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -100419,7 +100760,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -109524,8 +109865,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -109544,7 +109888,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -109552,6 +109895,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -109564,7 +109908,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -109722,8 +110066,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -109742,7 +110089,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -109750,6 +110096,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -109762,7 +110109,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -110183,8 +110530,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -110203,7 +110553,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -110211,6 +110560,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -110223,7 +110573,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -110385,8 +110735,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -110405,7 +110758,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -110413,6 +110765,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -110425,7 +110778,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -110916,8 +111269,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -110936,7 +111292,6 @@ get gateways(): (URL)[] { this, context, doc, - "inbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -110944,6 +111299,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -110956,7 +111312,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -111397,8 +111753,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -111417,7 +111776,6 @@ get gateways(): (URL)[] { this, context, doc, - "outbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -111425,6 +111783,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -111437,7 +111796,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -111858,8 +112217,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -111878,7 +112240,6 @@ get gateways(): (URL)[] { this, context, doc, - "following", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -111886,6 +112247,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -111898,7 +112260,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -112322,8 +112684,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -112342,7 +112707,6 @@ get gateways(): (URL)[] { this, context, doc, - "followers", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -112350,6 +112714,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -112362,7 +112727,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -112784,8 +113149,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -112804,7 +113172,6 @@ get gateways(): (URL)[] { this, context, doc, - "liked", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -112812,6 +113179,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -112824,7 +113192,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -113244,8 +113612,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -113264,7 +113635,6 @@ get gateways(): (URL)[] { this, context, doc, - "featured", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -113272,6 +113642,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -113284,7 +113655,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -113704,8 +114075,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -113724,7 +114098,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredTags", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -113732,6 +114105,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -113744,7 +114118,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -114161,8 +114535,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -114181,7 +114558,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredCollections", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -114189,6 +114565,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -114201,7 +114578,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -114622,8 +114999,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -114642,7 +115022,6 @@ get gateways(): (URL)[] { this, context, obj, - "streams", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -114650,6 +115029,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -114662,7 +115042,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -115225,8 +115605,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -115245,7 +115628,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "movedTo", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -115253,6 +115635,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -115265,7 +115648,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -115745,8 +116128,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -115765,7 +116151,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -115773,6 +116158,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -115785,7 +116171,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -115947,8 +116333,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -115967,7 +116356,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -115975,6 +116363,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -115987,7 +116376,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -116408,8 +116797,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -116428,7 +116820,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "service", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -116436,6 +116827,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -116448,7 +116840,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -116610,8 +117002,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -116630,7 +117025,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "service", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -116638,6 +117032,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -116650,7 +117045,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -121704,8 +122099,11 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -121724,7 +122122,6 @@ get names(): ((string | LanguageString))[] { this, context, obj, - "preview", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -121732,6 +122129,7 @@ get names(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -121744,7 +122142,7 @@ get names(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -129189,8 +129587,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -129209,7 +129610,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "quote", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -129217,6 +129617,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -129229,7 +129630,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -129670,8 +130071,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -129690,7 +130094,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "quoteAuthorization", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -129698,6 +130101,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -129710,7 +130114,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -131235,8 +131639,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -131255,7 +131662,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "orderedItems", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -131263,6 +131669,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -131275,7 +131682,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -135185,8 +135592,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -135205,7 +135615,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -135213,6 +135622,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -135225,7 +135635,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -135383,8 +135793,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -135403,7 +135816,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -135411,6 +135823,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -135423,7 +135836,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -135844,8 +136257,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -135864,7 +136280,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -135872,6 +136287,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -135884,7 +136300,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -136046,8 +136462,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -136066,7 +136485,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -136074,6 +136492,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -136086,7 +136505,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -136577,8 +136996,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -136597,7 +137019,6 @@ get gateways(): (URL)[] { this, context, doc, - "inbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -136605,6 +137026,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -136617,7 +137039,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -137058,8 +137480,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -137078,7 +137503,6 @@ get gateways(): (URL)[] { this, context, doc, - "outbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -137086,6 +137510,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -137098,7 +137523,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -137519,8 +137944,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -137539,7 +137967,6 @@ get gateways(): (URL)[] { this, context, doc, - "following", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -137547,6 +137974,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -137559,7 +137987,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -137983,8 +138411,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -138003,7 +138434,6 @@ get gateways(): (URL)[] { this, context, doc, - "followers", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -138011,6 +138441,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -138023,7 +138454,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -138445,8 +138876,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -138465,7 +138899,6 @@ get gateways(): (URL)[] { this, context, doc, - "liked", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -138473,6 +138906,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -138485,7 +138919,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -138905,8 +139339,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -138925,7 +139362,6 @@ get gateways(): (URL)[] { this, context, doc, - "featured", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -138933,6 +139369,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -138945,7 +139382,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -139365,8 +139802,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -139385,7 +139825,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredTags", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -139393,6 +139832,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -139405,7 +139845,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -139822,8 +140262,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -139842,7 +140285,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredCollections", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -139850,6 +140292,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -139862,7 +140305,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -140283,8 +140726,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -140303,7 +140749,6 @@ get gateways(): (URL)[] { this, context, obj, - "streams", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -140311,6 +140756,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -140323,7 +140769,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -140886,8 +141332,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -140906,7 +141355,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "movedTo", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -140914,6 +141362,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -140926,7 +141375,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -141406,8 +141855,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -141426,7 +141878,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -141434,6 +141885,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -141446,7 +141898,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -141608,8 +142060,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -141628,7 +142083,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -141636,6 +142090,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -141648,7 +142103,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -142069,8 +142524,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -142089,7 +142547,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "service", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -142097,6 +142554,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -142109,7 +142567,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -142271,8 +142729,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -142291,7 +142752,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "service", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -142299,6 +142759,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -142311,7 +142772,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -149414,8 +149875,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -149434,7 +149898,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -149442,6 +149905,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -149454,7 +149918,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -149612,8 +150076,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -149632,7 +150099,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -149640,6 +150106,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -149652,7 +150119,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -150073,8 +150540,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -150093,7 +150563,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -150101,6 +150570,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -150113,7 +150583,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -150275,8 +150745,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -150295,7 +150768,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -150303,6 +150775,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -150315,7 +150788,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -150806,8 +151279,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -150826,7 +151302,6 @@ get gateways(): (URL)[] { this, context, doc, - "inbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -150834,6 +151309,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -150846,7 +151322,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -151287,8 +151763,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -151307,7 +151786,6 @@ get gateways(): (URL)[] { this, context, doc, - "outbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -151315,6 +151793,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -151327,7 +151806,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -151748,8 +152227,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -151768,7 +152250,6 @@ get gateways(): (URL)[] { this, context, doc, - "following", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -151776,6 +152257,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -151788,7 +152270,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -152212,8 +152694,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -152232,7 +152717,6 @@ get gateways(): (URL)[] { this, context, doc, - "followers", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -152240,6 +152724,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -152252,7 +152737,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -152674,8 +153159,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -152694,7 +153182,6 @@ get gateways(): (URL)[] { this, context, doc, - "liked", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -152702,6 +153189,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -152714,7 +153202,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -153134,8 +153622,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -153154,7 +153645,6 @@ get gateways(): (URL)[] { this, context, doc, - "featured", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -153162,6 +153652,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -153174,7 +153665,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -153594,8 +154085,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -153614,7 +154108,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredTags", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -153622,6 +154115,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -153634,7 +154128,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -154051,8 +154545,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -154071,7 +154568,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredCollections", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -154079,6 +154575,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -154091,7 +154588,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -154512,8 +155009,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -154532,7 +155032,6 @@ get gateways(): (URL)[] { this, context, obj, - "streams", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -154540,6 +155039,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -154552,7 +155052,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -155115,8 +155615,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -155135,7 +155638,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "movedTo", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -155143,6 +155645,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -155155,7 +155658,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -155635,8 +156138,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -155655,7 +156161,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -155663,6 +156168,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -155675,7 +156181,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -155837,8 +156343,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -155857,7 +156366,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -155865,6 +156373,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -155877,7 +156386,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -156298,8 +156807,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -156318,7 +156830,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "service", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -156326,6 +156837,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -156338,7 +156850,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -156500,8 +157012,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -156520,7 +157035,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "service", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -156528,6 +157042,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -156540,7 +157055,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -162034,8 +162549,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -162054,7 +162572,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "describes", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -162062,6 +162579,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -162074,7 +162592,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -163834,8 +164352,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -163854,7 +164375,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "oneOf", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -163862,6 +164382,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -163874,7 +164395,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -164298,8 +164819,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -164318,7 +164842,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "anyOf", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -164326,6 +164849,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -164338,7 +164862,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -164788,8 +165312,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -164808,7 +165335,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "quote", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -164816,6 +165342,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -164828,7 +165355,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -165269,8 +165796,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -165289,7 +165819,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "quoteAuthorization", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -165297,6 +165826,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -165309,7 +165839,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -168411,8 +168941,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -168431,7 +168964,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "subject", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -168439,6 +168971,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -168451,7 +168984,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -168868,8 +169401,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -168888,7 +169424,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "object", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -168896,6 +169431,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -168908,7 +169444,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -169067,8 +169603,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -169087,7 +169626,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "object", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -169095,6 +169633,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -169107,7 +169646,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -169527,8 +170066,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -169547,7 +170089,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, doc, - "relationship", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -169555,6 +170096,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -169567,7 +170109,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -169728,8 +170270,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -169748,7 +170293,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); this, context, obj, - "relationship", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -169756,6 +170300,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -169768,7 +170313,7 @@ rawPropertyDescriptors.set(this.prototype, descriptors); }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -174325,8 +174870,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -174345,7 +174893,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -174353,6 +174900,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -174365,7 +174913,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -174523,8 +175071,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -174543,7 +175094,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "publicKey", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -174551,6 +175101,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -174563,7 +175114,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -174984,8 +175535,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -175004,7 +175558,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, doc, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -175012,6 +175565,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -175024,7 +175578,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -175186,8 +175740,11 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -175206,7 +175763,6 @@ get preferredUsernames(): ((string | LanguageString))[] { this, context, obj, - "assertionMethod", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -175214,6 +175770,7 @@ get preferredUsernames(): ((string | LanguageString))[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -175226,7 +175783,7 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -175717,8 +176274,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -175737,7 +176297,6 @@ get gateways(): (URL)[] { this, context, doc, - "inbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -175745,6 +176304,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -175757,7 +176317,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -176198,8 +176758,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -176218,7 +176781,6 @@ get gateways(): (URL)[] { this, context, doc, - "outbox", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -176226,6 +176788,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -176238,7 +176801,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -176659,8 +177222,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -176679,7 +177245,6 @@ get gateways(): (URL)[] { this, context, doc, - "following", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -176687,6 +177252,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -176699,7 +177265,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -177123,8 +177689,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -177143,7 +177712,6 @@ get gateways(): (URL)[] { this, context, doc, - "followers", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -177151,6 +177719,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -177163,7 +177732,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -177585,8 +178154,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -177605,7 +178177,6 @@ get gateways(): (URL)[] { this, context, doc, - "liked", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -177613,6 +178184,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -177625,7 +178197,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -178045,8 +178617,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -178065,7 +178640,6 @@ get gateways(): (URL)[] { this, context, doc, - "featured", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -178073,6 +178647,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -178085,7 +178660,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -178505,8 +179080,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -178525,7 +179103,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredTags", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -178533,6 +179110,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -178545,7 +179123,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -178962,8 +179540,11 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -178982,7 +179563,6 @@ get gateways(): (URL)[] { this, context, doc, - "featuredCollections", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -178990,6 +179570,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -179002,7 +179583,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -179423,8 +180004,11 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -179443,7 +180027,6 @@ get gateways(): (URL)[] { this, context, obj, - "streams", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -179451,6 +180034,7 @@ get gateways(): (URL)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -179463,7 +180047,7 @@ get gateways(): (URL)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -180026,8 +180610,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -180046,7 +180633,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "movedTo", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -180054,6 +180640,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -180066,7 +180653,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -180546,8 +181133,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -180566,7 +181156,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -180574,6 +181163,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -180586,7 +181176,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -180748,8 +181338,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -180768,7 +181361,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "alsoKnownAs", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -180776,6 +181368,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -180788,7 +181381,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, @@ -181209,8 +181802,11 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -181229,7 +181825,6 @@ get attributionDomains(): (string)[] { this, context, doc, - "service", ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -181237,6 +181832,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -181249,7 +181845,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -181411,8 +182007,11 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -181431,7 +182030,6 @@ get attributionDomains(): (string)[] { this, context, obj, - "service", ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -181439,6 +182037,7 @@ get attributionDomains(): (string)[] { inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: (options as { baseUrl?: URL }).baseUrl ?? @@ -181451,7 +182050,7 @@ get attributionDomains(): (string)[] { }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index ffa5cd2d1..b90f17047 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -491,8 +491,11 @@ async function* generateProperty( const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -516,7 +519,6 @@ async function* generateProperty( this, context, doc, - ${JSON.stringify(property.compactName)}, ) ) { const inherited = inheritJsonLdContext(context, doc); @@ -524,13 +526,14 @@ async function* generateProperty( inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: ${cachedPropertyBaseUrl}, }, ); await keepCachedJsonLd( - v as object, + v, doc, inherited, cachedContextLoader, @@ -714,8 +717,11 @@ async function* generateProperty( const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = options.contextLoader ?? - this._contextLoader ?? getDocumentLoader(); + const cachedContextLoader = shareContextLoader( + this._cachedJsonLd, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), + ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -739,7 +745,6 @@ async function* generateProperty( this, context, obj, - ${JSON.stringify(property.compactName)}, ) ) { const inherited = inheritJsonLdContext(context, obj); @@ -747,13 +752,14 @@ async function* generateProperty( inherited, { ...options, + contextLoader: cachedContextLoader, // Keep the parent default for embedded objects. verifyPortableObject: this._verifyPortableObject, baseUrl: ${cachedPropertyBaseUrl}, }, ); await keepCachedJsonLd( - v as object, + v, obj, inherited, cachedContextLoader, diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index e921188d0..d67657199 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -111,12 +111,15 @@ function getCachedJsonLdContext(object: object, context: unknown): unknown { // Puts the document an embedded object was received as back into its cache, // after decoding it from the result of inheritJsonLdContext(): async function keepCachedJsonLd( - object: object, + object: unknown, document: object, decoded: object, contextLoader: DocumentLoader, ): Promise { - if (decoded === document) return; + // A preprocessor can turn the value into a scalar: + if (decoded === document || object == null || typeof object !== "object") { + return; + } const target = object as unknown as { _cachedJsonLd?: unknown }; const cached = target._cachedJsonLd; if (cached == null) return; @@ -224,19 +227,18 @@ const fixedCachedJsonLd = new WeakSet(); // Whether an embedded document under a key of the cached JSON-LD of an object // can be decoded again. Prepending a context cannot rebuild what a context // that does not propagate to embedded nodes, in the document or in the embedded -// document, or a property-scoped context for the key took part in: +// document, or a type-scoped or property-scoped context took part in: function canDecodeCachedJsonLd( object: object, context: unknown, embedded: object, - key: string, ): boolean { return !fixedCachedJsonLd.has(object) && !isNonPropagatingContext(context) && !isNonPropagatingContext( (embedded as { "@context"?: unknown })["@context"], ) && - !hasPropertyScopedContext(context, key); + !hasScopedContext(context); } // Gives an object decoded with the whole document the document it was received @@ -253,14 +255,50 @@ function fixCachedJsonLd(object: unknown, document: object): void { fixedCachedJsonLd.add(object); } -function hasPropertyScopedContext(context: unknown, key: string): boolean { +function hasScopedContext(context: unknown): boolean { const entries = globalThis.Array.isArray(context) ? context : [context]; - return entries.some((entry) => { - const term = entry != null && typeof entry === "object" - ? (entry as Record)[key] - : undefined; - return term != null && typeof term === "object" && "@context" in term; - }); + return entries.some((entry) => + entry != null && typeof entry === "object" && + globalThis.Object.values(entry).some((term) => + term != null && typeof term === "object" && "@context" in term + ) + ); +} + +// Context loaders that load each URL once, keyed by the cached document whose +// embedded documents they decode and then by the wrapped loader. The documents +// can come from a remote peer, and decoding each of them with the parent's +// context must not multiply outbound requests by their number: +const sharedContextLoaders = new WeakMap< + object, + WeakMap +>(); + +function shareContextLoader( + document: object, + contextLoader: DocumentLoader, +): DocumentLoader { + let loaders = sharedContextLoaders.get(document); + if (loaders == null) { + loaders = new WeakMap(); + sharedContextLoaders.set(document, loaders); + } + let shared = loaders.get(contextLoader); + if (shared == null) { + const loads = new Map>(); + shared = (url, options) => { + let load = loads.get(url); + if (load == null) { + load = contextLoader(url, options); + loads.set(url, load); + // A failure is not remembered, so that a later call can try again: + load.catch(() => loads.delete(url)); + } + return load; + }; + loaders.set(contextLoader, shared); + } + return shared; } // Whether the embedded documents under a key of a compacted document are the diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index a2fbfc8d9..bd7c20055 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -415,6 +415,62 @@ test("embedded objects keep their received JSON-LD on the fallback path", async } }); +test("accessors do not load contexts once per embedded object", async () => { + const context = "https://example.com/contexts/extension"; + let loads = 0; + const contextLoader = (url: string) => { + if (url !== context) return mockDocumentLoader(url); + loads++; + return Promise.resolve({ + contextUrl: null, + documentUrl: url, + document: { "@context": { ext: "https://example.com/ns#" } }, + }); + }; + const note = await Note.fromJsonLd({ + "@context": [AS, context], + id: "https://example.com/notes/1", + type: "Note", + attachment: Array.from({ length: 50 }, (_, i) => ({ + "@context": AS, + type: "Document", + name: `Attachment ${i}`, + })), + }, { contextLoader }); + loads = 0; + const attachments = await Array.fromAsync( + note.getAttachments({ contextLoader }), + ); + strictEqual(attachments.length, 50); + ok(loads <= 5, `Loaded the context ${loads} times.`); +}); + +test("embedded objects keep values under type-scoped contexts", async () => { + const create = await Create.fromJsonLd({ + "@context": [AS, { + body: `${AS}#content`, + Create: { + "@id": `${AS}#Create`, + "@context": { "@propagate": true, body: null }, + }, + }], + id: "https://example.com/activities/1", + type: "Create", + actor: "https://example.com/users/alice", + object: { + "@context": AS, + id: "https://example.com/notes/1", + type: "Note", + // The type-scoped context of the parent removes this term: + body: "Not the content", + content: "Hello", + }, + }); + const note = await create.getObject(); + ok(note instanceof Note); + deepStrictEqual(note.contents, ["Hello"]); +}); + test("embedded objects keep values under property-scoped contexts", async () => { const create = await Create.fromJsonLd({ "@context": [AS, { From 37dae998a4da2ef83001c3ef3de8aa353ae57311 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Sat, 7 Nov 2026 02:07:52 +0900 Subject: [PATCH 34/35] Merge nested namespaces across reopened outer ones The raw-property-iri-invalid rule shared exported members between declarations of a namespace in the same lexical scope. A namespace nested in a reopened outer namespace has a different scope in each outer body, so its members were not shared, and a call to an exported function could be reported as a call to the imported helper. Nested declarations now merge by the merged outer namespace. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4494823482 Assisted-by: Claude Code:claude-opus-5-5 --- packages/lint/src/lib/raw-property-iri.ts | 8 +++++--- packages/lint/src/tests/raw-property-iri-invalid.test.ts | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/lint/src/lib/raw-property-iri.ts b/packages/lint/src/lib/raw-property-iri.ts index 44d7b5d67..b6e731f9e 100644 --- a/packages/lint/src/lib/raw-property-iri.ts +++ b/packages/lint/src/lib/raw-property-iri.ts @@ -297,12 +297,14 @@ export function checkRawPropertyIris( const root: Scope = { functionScope: true, bindings: new Map() }; // TypeScript merges namespaces and enums of the same name in a scope, and // makes what each declaration exports visible in the others: - const members = new Map>>(); + const members = new Map>>(); const blockMembers = new WeakMap>(); function mergedMembers(scope: Scope, id: string | undefined): Set { if (id == null) return new Set(); - let names = members.get(scope); - if (names == null) members.set(scope, names = new Map()); + // Declarations nested in a merged namespace merge with each other, too: + const owner = scope.merged ?? scope; + let names = members.get(owner); + if (names == null) members.set(owner, names = new Map()); let merged = names.get(id); if (merged == null) names.set(id, merged = new Set()); return merged; diff --git a/packages/lint/src/tests/raw-property-iri-invalid.test.ts b/packages/lint/src/tests/raw-property-iri-invalid.test.ts index ece7faac6..9b46b4b4a 100644 --- a/packages/lint/src/tests/raw-property-iri-invalid.test.ts +++ b/packages/lint/src/tests/raw-property-iri-invalid.test.ts @@ -240,6 +240,10 @@ cases.push( "merged namespace exported variables shadow helpers", `${setup} namespace N { export const read = (o: unknown, i: string) => {}; } namespace N { read({}, "content"); }`, ], + [ + "nested merged namespace exports shadow helpers", + `${setup} namespace N { export namespace Inner { export function read(o: unknown, i: string) {} } } namespace N { export namespace Inner { read({}, "content"); } }`, + ], [ "merged namespace locals do not shadow helpers", `${setup} namespace N { function read(o: unknown, i: string) {} } namespace N { read({}, "content"); }`, From e36c71a066edb58c2a40c0ddab505464009bc310 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Sat, 7 Nov 2026 02:31:56 +0900 Subject: [PATCH 35/35] Stop decoding cached embedded objects again Accessors decoded an embedded object that has its own @context again from the parent's cached JSON-LD, so that the returned object kept its received JSON-LD. An embedded document alone cannot reproduce what the parents' contexts contributed to it, and prepending them cannot either: type-scoped, property-scoped, and non-propagating contexts apply only while the whole document is decoded, and a remote context can hold any of them without the accessor being able to see it. The object decoded with the whole document already has the right values whatever the contexts are, so accessors now return it and give it the received document as its cache when that document matches the property. This removes the context inheritance for decoding, the checks for contexts that cannot be rebuilt, and the shared context loader. As a result, an accessor returns the same object on each call, the object no longer takes the document loaders passed to the accessor, and there is no reparse left to fail, so the tests for that are gone. https://github.com/fedify-dev/fedify/pull/1356#discussion_r4494823461 Assisted-by: Claude Code:claude-opus-5-5 --- CHANGES.md | 13 +- .../vocab-tools/embedded-object-context.md | 6 +- changes.d/vocab/embedded-object-context.md | 7 +- docs/manual/vocab.md | 5 +- .../src/__snapshots__/class.test.ts.deno.snap | 8027 ++--------------- .../src/__snapshots__/class.test.ts.node.snap | 8027 ++--------------- .../src/__snapshots__/class.test.ts.snap | 8027 ++--------------- packages/vocab-tools/src/property.ts | 79 +- packages/vocab-tools/src/raw-property.ts | 173 +- packages/vocab/src/raw-property.test.ts | 4 +- packages/vocab/src/vocab.test.ts | 84 +- 11 files changed, 1826 insertions(+), 22626 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e5f2c4c8f..7fa757a2a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -365,9 +365,10 @@ To be released. context defined could yield an object of another class or drop property values. It could also pick embedded objects under a term that the enclosing context mapped to another property. The accessors now - apply the enclosing context and fall back to the object decoded with the - whole document when the cached JSON-LD cannot be matched with it. - [[#1272], [#1356]] + return the object decoded with the whole document, which keeps the JSON-LD + it was received as for `toJsonLd()`. As a result, they return the same + object on each call, and an embedded object no longer takes the document + loaders passed to the accessor. [[#1272], [#1356]] [FEP-6757]: https://w3id.org/fep/6757 [#1212]: https://github.com/fedify-dev/fedify/issues/1212 @@ -419,10 +420,10 @@ To be released. a prefixed name like `dc:license` without the extra context. [[#1212], [#1241]] - Fixed generated accessors decoding embedded objects that have their own - `@context` without the enclosing document's context, which could + `@context` again without the enclosing document's context, which could return objects of another class, drop property values, or pick objects - under a term the enclosing context mapped to another property. - [[#1272], [#1356]] + under a term the enclosing context mapped to another property. They now + return the objects decoded with the whole document. [[#1272], [#1356]] - Generated vocabulary modules now export `getRawPropertyValues()` and `getRawPropertyValue()`, which read any property of a generated object by its full IRI, and their root classes implement `VocabularyObject` from diff --git a/changes.d/vocab-tools/embedded-object-context.md b/changes.d/vocab-tools/embedded-object-context.md index e97e1dea7..17dede6cb 100644 --- a/changes.d/vocab-tools/embedded-object-context.md +++ b/changes.d/vocab-tools/embedded-object-context.md @@ -4,7 +4,7 @@ links: '#1356': https://github.com/fedify-dev/fedify/pull/1356 --- - Fixed generated accessors decoding embedded objects that have their own - `@context` without the enclosing document's context, which could + `@context` again without the enclosing document's context, which could return objects of another class, drop property values, or pick objects - under a term the enclosing context mapped to another property. - [[#1272], [#1356]] + under a term the enclosing context mapped to another property. They now + return the objects decoded with the whole document. [[#1272], [#1356]] diff --git a/changes.d/vocab/embedded-object-context.md b/changes.d/vocab/embedded-object-context.md index 87641e811..24b965355 100644 --- a/changes.d/vocab/embedded-object-context.md +++ b/changes.d/vocab/embedded-object-context.md @@ -10,6 +10,7 @@ links: context defined could yield an object of another class or drop property values. It could also pick embedded objects under a term that the enclosing context mapped to another property. The accessors now - apply the enclosing context and fall back to the object decoded with the - whole document when the cached JSON-LD cannot be matched with it. - [[#1272], [#1356]] + return the object decoded with the whole document, which keeps the JSON-LD + it was received as for `toJsonLd()`. As a result, they return the same + object on each call, and an embedded object no longer takes the document + loaders passed to the accessor. [[#1272], [#1356]] diff --git a/docs/manual/vocab.md b/docs/manual/vocab.md index 2e81d1e51..47b147971 100644 --- a/docs/manual/vocab.md +++ b/docs/manual/vocab.md @@ -946,10 +946,7 @@ The `clone()` method accepts the same property values as the constructor. It makes a *shallow copy*: the clone has its own property arrays, but nested objects and URLs are shared with the source. Hydrating a shared nested object through either instance changes that nested object for both when their accessors -return the shared instance. A parsed source can return a fresh object instead: -if its cached JSON-LD contains an embedded object with its own `@context`, the -accessor re-parses that object on each call. Hydrating that returned object -does not update the nested instance stored in the source or clone. +return the shared instance. ### Deep copies diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index a355850a4..20b4de247 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -420,73 +420,46 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } -// The contexts embedded objects were decoded with, keyed by the objects. Their -// cached JSON-LD stays as it was received, as a proof can cover its context, so -// this is what decoding the objects nested in them has to start from: -const inheritedContexts = new WeakMap(); +// The contexts in effect for the cached JSON-LD of embedded objects, which +// stays as it was received, keyed by the objects. Telling which keys of such +// a document are which properties takes the contexts of its parents as well: +const cachedJsonLdContexts = new WeakMap(); function getCachedJsonLdContext(object: object, context: unknown): unknown { - return inheritedContexts.has(object) - ? inheritedContexts.get(object) + return cachedJsonLdContexts.has(object) + ? cachedJsonLdContexts.get(object) : context; } -// Puts the document an embedded object was received as back into its cache, -// after decoding it from the result of inheritJsonLdContext(): -async function keepCachedJsonLd( +// Objects that were given the document they were received as: +const receivedJsonLd = new WeakSet(); + +// Gives an embedded object, decoded along with the whole document, the document +// it was received as, which toJsonLd() has to return as is, as a proof can +// cover it. The object is not decoded from that document, since an embedded +// document alone cannot rebuild what its parents' contexts contributed to it, +// such as type-scoped and property-scoped contexts: +function keepReceivedJsonLd( object: unknown, document: object, - decoded: object, - contextLoader: DocumentLoader, -): Promise { - // A preprocessor can turn the value into a scalar: - if (decoded === document || object == null || typeof object !== \\"object\\") { - return; - } - const target = object as unknown as { _cachedJsonLd?: unknown }; - const cached = target._cachedJsonLd; - if (cached == null) return; - inheritedContexts.set(object, (decoded as { \\"@context\\"?: unknown })[\\"@context\\"]); - // The decoder can normalize what it caches, e.g., portable object IRIs: - target._cachedJsonLd = - globalThis.JSON.stringify(cached) === globalThis.JSON.stringify(decoded) - ? structuredClone(document) - : await compactJsonLdCache( - await jsonld.expand(cached, { - documentLoader: contextLoader, - keepFreeFloatingNodes: true, - }), - document, - contextLoader, - ); -} - -// Embeds the context of a cached document in a document embedded in it, so -// that decoding the embedded document alone resolves its terms the same way -// as decoding the whole document did. The parent's context entries keep -// their order, as later entries can refer to terms earlier ones define. -// When the embedded document's own context already begins with all of them, -// it is used as is, since applying the same entries again yields the same -// terms: -function inheritJsonLdContext( parentContext: unknown, - document: object, -): object { - const own = (document as { \\"@context\\"?: unknown })[\\"@context\\"]; - const ownEntries = globalThis.Array.isArray(own) ? own : [own]; - const parentEntries = globalThis.Array.isArray(parentContext) - ? parentContext - : [parentContext]; +): void { if ( - parentEntries.length <= ownEntries.length && - parentEntries.every((entry, i) => - globalThis.JSON.stringify(entry) === - globalThis.JSON.stringify(ownEntries[i]) - ) + object == null || typeof object !== \\"object\\" || + !(RAW_PROPERTY_PROTOCOL in object) || receivedJsonLd.has(object) ) { - return document; + return; } - return { ...document, \\"@context\\": [...parentEntries, ...ownEntries] }; + receivedJsonLd.add(object); + (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = + structuredClone(document); + const own = (document as { \\"@context\\"?: unknown })[\\"@context\\"]; + cachedJsonLdContexts.set(object, [ + ...(globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]), + ...(globalThis.Array.isArray(own) ? own : [own]), + ]); } // The results of isCachedPropertyKey(), keyed by the document and then by the @@ -536,94 +509,6 @@ async function mapsOnlyKeyToProperty( } } -// Only the first entry of a context can declare that it does not propagate: -function isNonPropagatingContext(context: unknown): boolean { - const first = globalThis.Array.isArray(context) ? context[0] : context; - return first != null && typeof first === \\"object\\" && - (first as Record)[\\"@propagate\\"] === false; -} - -// Objects whose contexts could not be rebuilt, so that neither they nor the -// objects nested in them can be decoded again from their cached JSON-LD: -const fixedCachedJsonLd = new WeakSet(); - -// Whether an embedded document under a key of the cached JSON-LD of an object -// can be decoded again. Prepending a context cannot rebuild what a context -// that does not propagate to embedded nodes, in the document or in the embedded -// document, or a type-scoped or property-scoped context took part in: -function canDecodeCachedJsonLd( - object: object, - context: unknown, - embedded: object, -): boolean { - return !fixedCachedJsonLd.has(object) && - !isNonPropagatingContext(context) && - !isNonPropagatingContext( - (embedded as { \\"@context\\"?: unknown })[\\"@context\\"], - ) && - !hasScopedContext(context); -} - -// Gives an object decoded with the whole document the document it was received -// as, which a proof can cover, when it cannot be decoded from that document: -function fixCachedJsonLd(object: unknown, document: object): void { - if ( - object == null || typeof object !== \\"object\\" || - !(RAW_PROPERTY_PROTOCOL in object) - ) { - return; - } - (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = - structuredClone(document); - fixedCachedJsonLd.add(object); -} - -function hasScopedContext(context: unknown): boolean { - const entries = globalThis.Array.isArray(context) ? context : [context]; - return entries.some((entry) => - entry != null && typeof entry === \\"object\\" && - globalThis.Object.values(entry).some((term) => - term != null && typeof term === \\"object\\" && \\"@context\\" in term - ) - ); -} - -// Context loaders that load each URL once, keyed by the cached document whose -// embedded documents they decode and then by the wrapped loader. The documents -// can come from a remote peer, and decoding each of them with the parent's -// context must not multiply outbound requests by their number: -const sharedContextLoaders = new WeakMap< - object, - WeakMap ->(); - -function shareContextLoader( - document: object, - contextLoader: DocumentLoader, -): DocumentLoader { - let loaders = sharedContextLoaders.get(document); - if (loaders == null) { - loaders = new WeakMap(); - sharedContextLoaders.set(document, loaders); - } - let shared = loaders.get(contextLoader); - if (shared == null) { - const loads = new Map>(); - shared = (url, options) => { - let load = loads.get(url); - if (load == null) { - load = contextLoader(url, options); - loads.set(url, load); - // A failure is not remembered, so that a later call can try again: - load.catch(() => loads.delete(url)); - } - return load; - }; - loaders.set(contextLoader, shared); - } - return shared; -} - // Whether the embedded documents under a key of a compacted document are the // values decoded for a property. The document has to map the key, and no other // key, to the property, as a context can remap the key or map another term to @@ -6567,11 +6452,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -6582,42 +6462,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"attachment\\", [\\"https://www.w3.org/ns/activitystreams#attachment\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attachment_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7090,11 +6939,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7105,42 +6949,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7294,11 +7107,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7309,42 +7117,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7756,11 +7533,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7771,42 +7543,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7959,11 +7700,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7974,42 +7710,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -8474,11 +8179,6 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -8489,42 +8189,11 @@ get contents(): ((string | LanguageString))[] { context, \\"context\\", [\\"https://www.w3.org/ns/activitystreams#context\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#context_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -8996,11 +8665,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9011,42 +8675,11 @@ get names(): ((string | LanguageString))[] { context, \\"generator\\", [\\"https://www.w3.org/ns/activitystreams#generator\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#generator_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -9481,11 +9114,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9496,42 +9124,11 @@ get names(): ((string | LanguageString))[] { context, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -9685,11 +9282,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9700,42 +9292,11 @@ get names(): ((string | LanguageString))[] { context, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -10170,11 +9731,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10185,42 +9741,11 @@ get names(): ((string | LanguageString))[] { context, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -10374,11 +9899,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10389,42 +9909,11 @@ get names(): ((string | LanguageString))[] { context, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -10851,11 +10340,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10866,42 +10350,11 @@ get names(): ((string | LanguageString))[] { context, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -11054,11 +10507,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11069,42 +10517,11 @@ get names(): ((string | LanguageString))[] { context, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -11531,11 +10948,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11546,42 +10958,11 @@ get names(): ((string | LanguageString))[] { context, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -11734,11 +11115,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11749,42 +11125,11 @@ get names(): ((string | LanguageString))[] { context, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -12210,11 +11555,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12225,42 +11565,11 @@ get names(): ((string | LanguageString))[] { context, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -12412,11 +11721,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12427,42 +11731,11 @@ get names(): ((string | LanguageString))[] { context, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -12887,11 +12160,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12902,42 +12170,11 @@ get names(): ((string | LanguageString))[] { context, \\"replies\\", [\\"https://www.w3.org/ns/activitystreams#replies\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replies_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -13354,11 +12591,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -13369,42 +12601,11 @@ get names(): ((string | LanguageString))[] { context, \\"shares\\", [\\"https://www.w3.org/ns/activitystreams#shares\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#shares_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -13821,11 +13022,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -13836,42 +13032,11 @@ get names(): ((string | LanguageString))[] { context, \\"likes\\", [\\"https://www.w3.org/ns/activitystreams#likes\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likes_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -14282,11 +13447,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -14297,42 +13457,11 @@ get names(): ((string | LanguageString))[] { context, \\"emojiReactions\\", [\\"http://fedibird.com/ns#emojiReactions\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#emojiReactions_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -14804,11 +13933,6 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -14819,42 +13943,11 @@ get summaries(): ((string | LanguageString))[] { context, \\"tag\\", [\\"https://www.w3.org/ns/activitystreams#tag\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#tag_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -15300,11 +14393,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15315,42 +14403,11 @@ get urls(): ((URL | Link))[] { context, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -15503,11 +14560,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15518,42 +14570,11 @@ get urls(): ((URL | Link))[] { context, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -15965,11 +14986,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15980,42 +14996,11 @@ get urls(): ((URL | Link))[] { context, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -16168,11 +15153,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16183,42 +15163,11 @@ get urls(): ((URL | Link))[] { context, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -16630,11 +15579,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16645,42 +15589,11 @@ get urls(): ((URL | Link))[] { context, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -16833,11 +15746,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16848,42 +15756,11 @@ get urls(): ((URL | Link))[] { context, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -17295,11 +16172,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17310,42 +16182,11 @@ get urls(): ((URL | Link))[] { context, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -17498,11 +16339,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17513,42 +16349,11 @@ get urls(): ((URL | Link))[] { context, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -18023,11 +16828,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18038,42 +16838,11 @@ get urls(): ((URL | Link))[] { context, \\"proof\\", [\\"https://w3id.org/security#proof\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -18225,11 +16994,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18240,42 +17004,11 @@ get urls(): ((URL | Link))[] { context, \\"proof\\", [\\"https://w3id.org/security#proof\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -18726,11 +17459,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18741,42 +17469,11 @@ get urls(): ((URL | Link))[] { context, \\"likeAuthorization\\", [\\"https://gotosocial.org/ns#likeAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likeAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -19187,11 +17884,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -19202,42 +17894,11 @@ get urls(): ((URL | Link))[] { context, \\"replyAuthorization\\", [\\"https://gotosocial.org/ns#replyAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -19648,11 +18309,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -19663,42 +18319,11 @@ get urls(): ((URL | Link))[] { context, \\"announceAuthorization\\", [\\"https://gotosocial.org/ns#announceAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#announceAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -26236,11 +24861,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -26251,42 +24871,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -26720,11 +25309,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -26735,42 +25319,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -29272,11 +27825,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29287,42 +27835,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -29476,11 +27993,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29491,42 +28003,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -29939,11 +28420,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29954,42 +28430,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -30143,11 +28588,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30158,42 +28598,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -30609,11 +29018,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30624,42 +29028,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -30816,11 +29189,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30831,42 +29199,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -31279,11 +29616,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31294,42 +29626,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -31483,11 +29784,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31498,42 +29794,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -31947,11 +30212,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31962,42 +30222,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -32152,11 +30381,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32167,42 +30391,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -32614,11 +30807,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32629,42 +30817,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#instrument_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -32817,11 +30974,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32832,42 +30984,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#instrument_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -37187,11 +35308,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -37202,42 +35318,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -37647,11 +35732,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -37662,42 +35742,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -42300,11 +40349,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -42315,42 +40359,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -42760,11 +40773,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -42775,42 +40783,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -44716,11 +42693,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -44731,42 +42703,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -45176,11 +43117,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -45191,42 +43127,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -47131,11 +45036,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -47146,42 +45046,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -47591,11 +45460,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -47606,42 +45470,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -50184,11 +48017,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -50199,42 +48027,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"translator\\", [\\"https://schema.org/translator\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#translator_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -50391,11 +48188,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -50406,42 +48198,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"translator\\", [\\"https://schema.org/translator\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#translator_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -52279,11 +50040,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -52294,42 +50050,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -52738,11 +50463,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -52753,42 +50473,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -55682,11 +53371,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -55697,42 +53381,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"current\\", [\\"https://www.w3.org/ns/activitystreams#current\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#current_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -56143,11 +53796,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -56158,42 +53806,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"first\\", [\\"https://www.w3.org/ns/activitystreams#first\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#first_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -56604,11 +54221,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -56619,42 +54231,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"last\\", [\\"https://www.w3.org/ns/activitystreams#last\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#last_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -57084,11 +54665,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -57099,42 +54675,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"items\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -57545,11 +55090,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -57560,42 +55100,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"likesOf\\", [\\"https://w3id.org/fep/5711#likesOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likesOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -58005,11 +55514,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58020,42 +55524,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"sharesOf\\", [\\"https://w3id.org/fep/5711#sharesOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#sharesOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -58465,11 +55938,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58480,42 +55948,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"repliesOf\\", [\\"https://w3id.org/fep/5711#repliesOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#repliesOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -58925,11 +56362,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58940,42 +56372,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"inboxOf\\", [\\"https://w3id.org/fep/5711#inboxOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inboxOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -59385,11 +56786,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -59400,42 +56796,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"outboxOf\\", [\\"https://w3id.org/fep/5711#outboxOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outboxOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -59845,11 +57210,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -59860,42 +57220,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"followersOf\\", [\\"https://w3id.org/fep/5711#followersOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followersOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -60305,11 +57634,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -60320,42 +57644,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"followingOf\\", [\\"https://w3id.org/fep/5711#followingOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followingOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -60765,11 +58058,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -60780,42 +58068,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"likedOf\\", [\\"https://w3id.org/fep/5711#likedOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likedOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -63401,11 +60658,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -63416,42 +60668,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -65626,11 +62847,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -65641,42 +62857,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"featuredObject\\", [\\"https://w3id.org/fep/7aa9#featuredObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -66087,11 +63272,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -66102,42 +63282,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"featureAuthorization\\", [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featureAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -70736,11 +67885,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -70751,42 +67895,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"owner\\", [\\"https://w3id.org/security#owner\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#owner_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -72316,11 +69429,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -72331,42 +69439,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"controller\\", [\\"https://w3id.org/security#controller\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#controller_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -82680,11 +79757,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -82695,42 +79767,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -82881,11 +79922,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -82896,42 +79932,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -83345,11 +80350,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83360,42 +80360,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -83550,11 +80519,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83565,42 +80529,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -84084,11 +81017,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -84099,42 +81027,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -84568,11 +81465,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -84583,42 +81475,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -85032,11 +81893,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85047,42 +81903,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -85499,11 +82324,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85514,42 +82334,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -85964,11 +82753,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85979,42 +82763,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -86427,11 +83180,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -86442,42 +83190,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -86890,11 +83607,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -86905,42 +83617,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -87350,11 +84031,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -87365,42 +84041,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -87814,11 +84459,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -87829,42 +84469,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -88420,11 +85029,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88435,42 +85039,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -88943,11 +85516,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88958,42 +85526,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -89148,11 +85685,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89163,42 +85695,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -89612,11 +86113,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89627,42 +86123,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -89817,11 +86282,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89832,42 +86292,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -95058,11 +91487,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -95073,42 +91497,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -95542,11 +91935,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -95557,42 +91945,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -99798,11 +96155,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -99813,42 +96165,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"partOf\\", [\\"https://www.w3.org/ns/activitystreams#partOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#partOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -100257,11 +96578,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -100272,42 +96588,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"next\\", [\\"https://www.w3.org/ns/activitystreams#next\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#next_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -100717,11 +97002,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -100732,42 +97012,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"prev\\", [\\"https://www.w3.org/ns/activitystreams#prev\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#prev_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -109865,11 +106114,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -109880,42 +106124,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -110066,11 +106279,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110081,42 +106289,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -110530,11 +106707,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110545,42 +106717,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -110735,11 +106876,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110750,42 +106886,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -111269,11 +107374,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -111284,42 +107384,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -111753,11 +107822,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -111768,42 +107832,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -112217,11 +108250,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -112232,42 +108260,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -112684,11 +108681,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -112699,42 +108691,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -113149,11 +109110,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -113164,42 +109120,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -113612,11 +109537,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -113627,42 +109547,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -114075,11 +109964,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -114090,42 +109974,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -114535,11 +110388,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -114550,42 +110398,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -114999,11 +110816,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115014,42 +110826,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -115605,11 +111386,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115620,42 +111396,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -116128,11 +111873,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116143,42 +111883,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -116333,11 +112042,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116348,42 +112052,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -116797,11 +112470,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116812,42 +112480,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -117002,11 +112639,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -117017,42 +112649,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -122099,11 +117700,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -122114,42 +117710,11 @@ get names(): ((string | LanguageString))[] { context, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -129587,11 +125152,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -129602,42 +125162,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -130071,11 +125600,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -130086,42 +125610,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -131639,11 +127132,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -131654,42 +127142,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -135592,11 +131049,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135607,42 +131059,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -135793,11 +131214,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135808,42 +131224,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -136257,11 +131642,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -136272,42 +131652,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -136462,11 +131811,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -136477,42 +131821,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -136996,11 +132309,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137011,42 +132319,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -137480,11 +132757,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137495,42 +132767,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -137944,11 +133185,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137959,42 +133195,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -138411,11 +133616,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138426,42 +133626,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -138876,11 +134045,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138891,42 +134055,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -139339,11 +134472,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -139354,42 +134482,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -139802,11 +134899,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -139817,42 +134909,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -140262,11 +135323,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -140277,42 +135333,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -140726,11 +135751,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -140741,42 +135761,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -141332,11 +136321,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -141347,42 +136331,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -141855,11 +136808,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -141870,42 +136818,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -142060,11 +136977,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142075,42 +136987,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -142524,11 +137405,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142539,42 +137415,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -142729,11 +137574,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142744,42 +137584,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -149875,11 +144684,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -149890,42 +144694,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -150076,11 +144849,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150091,42 +144859,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -150540,11 +145277,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150555,42 +145287,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -150745,11 +145446,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150760,42 +145456,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -151279,11 +145944,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -151294,42 +145954,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -151763,11 +146392,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -151778,42 +146402,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -152227,11 +146820,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -152242,42 +146830,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -152694,11 +147251,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -152709,42 +147261,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -153159,11 +147680,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -153174,42 +147690,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -153622,11 +148107,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -153637,42 +148117,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -154085,11 +148534,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -154100,42 +148544,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -154545,11 +148958,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -154560,42 +148968,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -155009,11 +149386,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155024,42 +149396,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -155615,11 +149956,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155630,42 +149966,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -156138,11 +150443,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156153,42 +150453,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -156343,11 +150612,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156358,42 +150622,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -156807,11 +151040,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156822,42 +151050,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -157012,11 +151209,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -157027,42 +151219,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -162549,11 +156710,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -162564,42 +156720,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"describes\\", [\\"https://www.w3.org/ns/activitystreams#describes\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#describes_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -164352,11 +158477,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -164367,42 +158487,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"oneOf\\", [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#exclusiveOption_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -164819,11 +158908,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -164834,42 +158918,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"anyOf\\", [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#inclusiveOption_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -165312,11 +159365,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -165327,42 +159375,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -165796,11 +159813,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -165811,42 +159823,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -168941,11 +162922,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -168956,42 +162932,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"subject\\", [\\"https://www.w3.org/ns/activitystreams#subject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#subject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -169401,11 +163346,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169416,42 +163356,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -169603,11 +163512,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169618,42 +163522,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -170066,11 +163939,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -170081,42 +163949,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -170270,11 +164107,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -170285,42 +164117,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -174870,11 +168671,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -174885,42 +168681,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -175071,11 +168836,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175086,42 +168846,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -175535,11 +169264,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175550,42 +169274,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -175740,11 +169433,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175755,42 +169443,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -176274,11 +169931,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -176289,42 +169941,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -176758,11 +170379,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -176773,42 +170389,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -177222,11 +170807,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -177237,42 +170817,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -177689,11 +171238,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -177704,42 +171248,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -178154,11 +171667,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178169,42 +171677,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -178617,11 +172094,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178632,42 +172104,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -179080,11 +172521,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -179095,42 +172531,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -179540,11 +172945,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -179555,42 +172955,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -180004,11 +173373,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180019,42 +173383,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -180610,11 +173943,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180625,42 +173953,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -181133,11 +174430,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181148,42 +174440,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -181338,11 +174599,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181353,42 +174609,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -181802,11 +175027,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181817,42 +175037,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -182007,11 +175196,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -182022,42 +175206,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index cc77da37c..af84e7661 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -418,73 +418,46 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } -// The contexts embedded objects were decoded with, keyed by the objects. Their -// cached JSON-LD stays as it was received, as a proof can cover its context, so -// this is what decoding the objects nested in them has to start from: -const inheritedContexts = new WeakMap(); +// The contexts in effect for the cached JSON-LD of embedded objects, which +// stays as it was received, keyed by the objects. Telling which keys of such +// a document are which properties takes the contexts of its parents as well: +const cachedJsonLdContexts = new WeakMap(); function getCachedJsonLdContext(object: object, context: unknown): unknown { - return inheritedContexts.has(object) - ? inheritedContexts.get(object) + return cachedJsonLdContexts.has(object) + ? cachedJsonLdContexts.get(object) : context; } -// Puts the document an embedded object was received as back into its cache, -// after decoding it from the result of inheritJsonLdContext(): -async function keepCachedJsonLd( +// Objects that were given the document they were received as: +const receivedJsonLd = new WeakSet(); + +// Gives an embedded object, decoded along with the whole document, the document +// it was received as, which toJsonLd() has to return as is, as a proof can +// cover it. The object is not decoded from that document, since an embedded +// document alone cannot rebuild what its parents' contexts contributed to it, +// such as type-scoped and property-scoped contexts: +function keepReceivedJsonLd( object: unknown, document: object, - decoded: object, - contextLoader: DocumentLoader, -): Promise { - // A preprocessor can turn the value into a scalar: - if (decoded === document || object == null || typeof object !== \\"object\\") { - return; - } - const target = object as unknown as { _cachedJsonLd?: unknown }; - const cached = target._cachedJsonLd; - if (cached == null) return; - inheritedContexts.set(object, (decoded as { \\"@context\\"?: unknown })[\\"@context\\"]); - // The decoder can normalize what it caches, e.g., portable object IRIs: - target._cachedJsonLd = - globalThis.JSON.stringify(cached) === globalThis.JSON.stringify(decoded) - ? structuredClone(document) - : await compactJsonLdCache( - await jsonld.expand(cached, { - documentLoader: contextLoader, - keepFreeFloatingNodes: true, - }), - document, - contextLoader, - ); -} - -// Embeds the context of a cached document in a document embedded in it, so -// that decoding the embedded document alone resolves its terms the same way -// as decoding the whole document did. The parent's context entries keep -// their order, as later entries can refer to terms earlier ones define. -// When the embedded document's own context already begins with all of them, -// it is used as is, since applying the same entries again yields the same -// terms: -function inheritJsonLdContext( parentContext: unknown, - document: object, -): object { - const own = (document as { \\"@context\\"?: unknown })[\\"@context\\"]; - const ownEntries = globalThis.Array.isArray(own) ? own : [own]; - const parentEntries = globalThis.Array.isArray(parentContext) - ? parentContext - : [parentContext]; +): void { if ( - parentEntries.length <= ownEntries.length && - parentEntries.every((entry, i) => - globalThis.JSON.stringify(entry) === - globalThis.JSON.stringify(ownEntries[i]) - ) + object == null || typeof object !== \\"object\\" || + !(RAW_PROPERTY_PROTOCOL in object) || receivedJsonLd.has(object) ) { - return document; + return; } - return { ...document, \\"@context\\": [...parentEntries, ...ownEntries] }; + receivedJsonLd.add(object); + (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = + structuredClone(document); + const own = (document as { \\"@context\\"?: unknown })[\\"@context\\"]; + cachedJsonLdContexts.set(object, [ + ...(globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]), + ...(globalThis.Array.isArray(own) ? own : [own]), + ]); } // The results of isCachedPropertyKey(), keyed by the document and then by the @@ -534,94 +507,6 @@ async function mapsOnlyKeyToProperty( } } -// Only the first entry of a context can declare that it does not propagate: -function isNonPropagatingContext(context: unknown): boolean { - const first = globalThis.Array.isArray(context) ? context[0] : context; - return first != null && typeof first === \\"object\\" && - (first as Record)[\\"@propagate\\"] === false; -} - -// Objects whose contexts could not be rebuilt, so that neither they nor the -// objects nested in them can be decoded again from their cached JSON-LD: -const fixedCachedJsonLd = new WeakSet(); - -// Whether an embedded document under a key of the cached JSON-LD of an object -// can be decoded again. Prepending a context cannot rebuild what a context -// that does not propagate to embedded nodes, in the document or in the embedded -// document, or a type-scoped or property-scoped context took part in: -function canDecodeCachedJsonLd( - object: object, - context: unknown, - embedded: object, -): boolean { - return !fixedCachedJsonLd.has(object) && - !isNonPropagatingContext(context) && - !isNonPropagatingContext( - (embedded as { \\"@context\\"?: unknown })[\\"@context\\"], - ) && - !hasScopedContext(context); -} - -// Gives an object decoded with the whole document the document it was received -// as, which a proof can cover, when it cannot be decoded from that document: -function fixCachedJsonLd(object: unknown, document: object): void { - if ( - object == null || typeof object !== \\"object\\" || - !(RAW_PROPERTY_PROTOCOL in object) - ) { - return; - } - (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = - structuredClone(document); - fixedCachedJsonLd.add(object); -} - -function hasScopedContext(context: unknown): boolean { - const entries = globalThis.Array.isArray(context) ? context : [context]; - return entries.some((entry) => - entry != null && typeof entry === \\"object\\" && - globalThis.Object.values(entry).some((term) => - term != null && typeof term === \\"object\\" && \\"@context\\" in term - ) - ); -} - -// Context loaders that load each URL once, keyed by the cached document whose -// embedded documents they decode and then by the wrapped loader. The documents -// can come from a remote peer, and decoding each of them with the parent's -// context must not multiply outbound requests by their number: -const sharedContextLoaders = new WeakMap< - object, - WeakMap ->(); - -function shareContextLoader( - document: object, - contextLoader: DocumentLoader, -): DocumentLoader { - let loaders = sharedContextLoaders.get(document); - if (loaders == null) { - loaders = new WeakMap(); - sharedContextLoaders.set(document, loaders); - } - let shared = loaders.get(contextLoader); - if (shared == null) { - const loads = new Map>(); - shared = (url, options) => { - let load = loads.get(url); - if (load == null) { - load = contextLoader(url, options); - loads.set(url, load); - // A failure is not remembered, so that a later call can try again: - load.catch(() => loads.delete(url)); - } - return load; - }; - loaders.set(contextLoader, shared); - } - return shared; -} - // Whether the embedded documents under a key of a compacted document are the // values decoded for a property. The document has to map the key, and no other // key, to the property, as a context can remap the key or map another term to @@ -6565,11 +6450,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -6580,42 +6460,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"attachment\\", [\\"https://www.w3.org/ns/activitystreams#attachment\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attachment_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7088,11 +6937,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7103,42 +6947,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7292,11 +7105,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7307,42 +7115,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"attributedTo\\", [\\"https://www.w3.org/ns/activitystreams#attributedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7754,11 +7531,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7769,42 +7541,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7957,11 +7698,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -7972,42 +7708,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"audience\\", [\\"https://www.w3.org/ns/activitystreams#audience\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -8472,11 +8177,6 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -8487,42 +8187,11 @@ get contents(): ((string | LanguageString))[] { context, \\"context\\", [\\"https://www.w3.org/ns/activitystreams#context\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#context_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -8994,11 +8663,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9009,42 +8673,11 @@ get names(): ((string | LanguageString))[] { context, \\"generator\\", [\\"https://www.w3.org/ns/activitystreams#generator\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#generator_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -9479,11 +9112,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9494,42 +9122,11 @@ get names(): ((string | LanguageString))[] { context, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -9683,11 +9280,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -9698,42 +9290,11 @@ get names(): ((string | LanguageString))[] { context, \\"icon\\", [\\"https://www.w3.org/ns/activitystreams#icon\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -10168,11 +9729,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10183,42 +9739,11 @@ get names(): ((string | LanguageString))[] { context, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -10372,11 +9897,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10387,42 +9907,11 @@ get names(): ((string | LanguageString))[] { context, \\"image\\", [\\"https://www.w3.org/ns/activitystreams#image\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -10849,11 +10338,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -10864,42 +10348,11 @@ get names(): ((string | LanguageString))[] { context, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -11052,11 +10505,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11067,42 +10515,11 @@ get names(): ((string | LanguageString))[] { context, \\"inReplyTo\\", [\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -11529,11 +10946,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11544,42 +10956,11 @@ get names(): ((string | LanguageString))[] { context, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -11732,11 +11113,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -11747,42 +11123,11 @@ get names(): ((string | LanguageString))[] { context, \\"location\\", [\\"https://www.w3.org/ns/activitystreams#location\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -12208,11 +11553,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12223,42 +11563,11 @@ get names(): ((string | LanguageString))[] { context, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -12410,11 +11719,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12425,42 +11729,11 @@ get names(): ((string | LanguageString))[] { context, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -12885,11 +12158,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -12900,42 +12168,11 @@ get names(): ((string | LanguageString))[] { context, \\"replies\\", [\\"https://www.w3.org/ns/activitystreams#replies\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replies_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -13352,11 +12589,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -13367,42 +12599,11 @@ get names(): ((string | LanguageString))[] { context, \\"shares\\", [\\"https://www.w3.org/ns/activitystreams#shares\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#shares_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -13819,11 +13020,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -13834,42 +13030,11 @@ get names(): ((string | LanguageString))[] { context, \\"likes\\", [\\"https://www.w3.org/ns/activitystreams#likes\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likes_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -14280,11 +13445,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -14295,42 +13455,11 @@ get names(): ((string | LanguageString))[] { context, \\"emojiReactions\\", [\\"http://fedibird.com/ns#emojiReactions\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#emojiReactions_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -14802,11 +13931,6 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -14817,42 +13941,11 @@ get summaries(): ((string | LanguageString))[] { context, \\"tag\\", [\\"https://www.w3.org/ns/activitystreams#tag\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#tag_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -15298,11 +14391,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15313,42 +14401,11 @@ get urls(): ((URL | Link))[] { context, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -15501,11 +14558,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15516,42 +14568,11 @@ get urls(): ((URL | Link))[] { context, \\"to\\", [\\"https://www.w3.org/ns/activitystreams#to\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -15963,11 +14984,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -15978,42 +14994,11 @@ get urls(): ((URL | Link))[] { context, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -16166,11 +15151,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16181,42 +15161,11 @@ get urls(): ((URL | Link))[] { context, \\"bto\\", [\\"https://www.w3.org/ns/activitystreams#bto\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -16628,11 +15577,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16643,42 +15587,11 @@ get urls(): ((URL | Link))[] { context, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -16831,11 +15744,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -16846,42 +15754,11 @@ get urls(): ((URL | Link))[] { context, \\"cc\\", [\\"https://www.w3.org/ns/activitystreams#cc\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -17293,11 +16170,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17308,42 +16180,11 @@ get urls(): ((URL | Link))[] { context, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -17496,11 +16337,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -17511,42 +16347,11 @@ get urls(): ((URL | Link))[] { context, \\"bcc\\", [\\"https://www.w3.org/ns/activitystreams#bcc\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -18021,11 +16826,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18036,42 +16836,11 @@ get urls(): ((URL | Link))[] { context, \\"proof\\", [\\"https://w3id.org/security#proof\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -18223,11 +16992,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18238,42 +17002,11 @@ get urls(): ((URL | Link))[] { context, \\"proof\\", [\\"https://w3id.org/security#proof\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -18724,11 +17457,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -18739,42 +17467,11 @@ get urls(): ((URL | Link))[] { context, \\"likeAuthorization\\", [\\"https://gotosocial.org/ns#likeAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likeAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -19185,11 +17882,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -19200,42 +17892,11 @@ get urls(): ((URL | Link))[] { context, \\"replyAuthorization\\", [\\"https://gotosocial.org/ns#replyAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -19646,11 +18307,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -19661,42 +18317,11 @@ get urls(): ((URL | Link))[] { context, \\"announceAuthorization\\", [\\"https://gotosocial.org/ns#announceAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#announceAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -26234,11 +24859,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -26249,42 +24869,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -26718,11 +25307,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -26733,42 +25317,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -29270,11 +27823,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29285,42 +27833,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -29474,11 +27991,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29489,42 +28001,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"actor\\", [\\"https://www.w3.org/ns/activitystreams#actor\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -29937,11 +28418,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -29952,42 +28428,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -30141,11 +28586,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30156,42 +28596,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -30607,11 +29016,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30622,42 +29026,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -30814,11 +29187,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -30829,42 +29197,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"target\\", [\\"https://www.w3.org/ns/activitystreams#target\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -31277,11 +29614,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31292,42 +29624,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -31481,11 +29782,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31496,42 +29792,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"result\\", [\\"https://www.w3.org/ns/activitystreams#result\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -31945,11 +30210,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -31960,42 +30220,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -32150,11 +30379,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32165,42 +30389,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"origin\\", [\\"https://www.w3.org/ns/activitystreams#origin\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -32612,11 +30805,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32627,42 +30815,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#instrument_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -32815,11 +30972,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -32830,42 +30982,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"instrument\\", [\\"https://www.w3.org/ns/activitystreams#instrument\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#instrument_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -37185,11 +35306,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -37200,42 +35316,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -37645,11 +35730,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -37660,42 +35740,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -42298,11 +40347,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -42313,42 +40357,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -42758,11 +40771,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -42773,42 +40781,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -44714,11 +42691,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -44729,42 +42701,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -45174,11 +43115,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -45189,42 +43125,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -47129,11 +45034,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -47144,42 +45044,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -47589,11 +45458,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -47604,42 +45468,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -50182,11 +48015,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -50197,42 +48025,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"translator\\", [\\"https://schema.org/translator\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#translator_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -50389,11 +48186,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -50404,42 +48196,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"translator\\", [\\"https://schema.org/translator\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#translator_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -52277,11 +50038,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -52292,42 +50048,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactingObject\\", [\\"https://gotosocial.org/ns#interactingObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -52736,11 +50461,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -52751,42 +50471,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"interactionTarget\\", [\\"https://gotosocial.org/ns#interactionTarget\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -55680,11 +53369,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -55695,42 +53379,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"current\\", [\\"https://www.w3.org/ns/activitystreams#current\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#current_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -56141,11 +53794,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -56156,42 +53804,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"first\\", [\\"https://www.w3.org/ns/activitystreams#first\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#first_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -56602,11 +54219,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -56617,42 +54229,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"last\\", [\\"https://www.w3.org/ns/activitystreams#last\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#last_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -57082,11 +54663,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -57097,42 +54673,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"items\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -57543,11 +55088,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -57558,42 +55098,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"likesOf\\", [\\"https://w3id.org/fep/5711#likesOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likesOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -58003,11 +55512,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58018,42 +55522,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"sharesOf\\", [\\"https://w3id.org/fep/5711#sharesOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#sharesOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -58463,11 +55936,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58478,42 +55946,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"repliesOf\\", [\\"https://w3id.org/fep/5711#repliesOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#repliesOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -58923,11 +56360,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -58938,42 +56370,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"inboxOf\\", [\\"https://w3id.org/fep/5711#inboxOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inboxOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -59383,11 +56784,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -59398,42 +56794,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"outboxOf\\", [\\"https://w3id.org/fep/5711#outboxOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outboxOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -59843,11 +57208,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -59858,42 +57218,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"followersOf\\", [\\"https://w3id.org/fep/5711#followersOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followersOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -60303,11 +57632,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -60318,42 +57642,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"followingOf\\", [\\"https://w3id.org/fep/5711#followingOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followingOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -60763,11 +58056,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -60778,42 +58066,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"likedOf\\", [\\"https://w3id.org/fep/5711#likedOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likedOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -63399,11 +60656,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -63414,42 +60666,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -65624,11 +62845,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -65639,42 +62855,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"featuredObject\\", [\\"https://w3id.org/fep/7aa9#featuredObject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -66085,11 +63270,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -66100,42 +63280,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"featureAuthorization\\", [\\"https://w3id.org/fep/7aa9#featureAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featureAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -70734,11 +67883,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -70749,42 +67893,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"owner\\", [\\"https://w3id.org/security#owner\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#owner_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -72314,11 +69427,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -72329,42 +69437,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"controller\\", [\\"https://w3id.org/security#controller\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#controller_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -82678,11 +79755,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -82693,42 +79765,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -82879,11 +79920,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -82894,42 +79930,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -83343,11 +80348,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83358,42 +80358,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -83548,11 +80517,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -83563,42 +80527,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -84082,11 +81015,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -84097,42 +81025,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -84566,11 +81463,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -84581,42 +81473,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -85030,11 +81891,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85045,42 +81901,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -85497,11 +82322,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85512,42 +82332,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -85962,11 +82751,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -85977,42 +82761,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -86425,11 +83178,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -86440,42 +83188,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -86888,11 +83605,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -86903,42 +83615,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -87348,11 +84029,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -87363,42 +84039,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -87812,11 +84457,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -87827,42 +84467,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -88418,11 +85027,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88433,42 +85037,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -88941,11 +85514,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -88956,42 +85524,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -89146,11 +85683,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89161,42 +85693,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -89610,11 +86111,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89625,42 +86121,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -89815,11 +86280,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -89830,42 +86290,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -95056,11 +91485,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -95071,42 +91495,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -95540,11 +91933,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -95555,42 +91943,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -99796,11 +96153,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -99811,42 +96163,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"partOf\\", [\\"https://www.w3.org/ns/activitystreams#partOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#partOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -100255,11 +96576,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -100270,42 +96586,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"next\\", [\\"https://www.w3.org/ns/activitystreams#next\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#next_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -100715,11 +97000,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -100730,42 +97010,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"prev\\", [\\"https://www.w3.org/ns/activitystreams#prev\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#prev_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -109863,11 +106112,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -109878,42 +106122,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -110064,11 +106277,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110079,42 +106287,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -110528,11 +106705,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110543,42 +106715,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -110733,11 +106874,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -110748,42 +106884,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -111267,11 +107372,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -111282,42 +107382,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -111751,11 +107820,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -111766,42 +107830,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -112215,11 +108248,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -112230,42 +108258,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -112682,11 +108679,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -112697,42 +108689,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -113147,11 +109108,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -113162,42 +109118,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -113610,11 +109535,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -113625,42 +109545,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -114073,11 +109962,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -114088,42 +109972,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -114533,11 +110386,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -114548,42 +110396,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -114997,11 +110814,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115012,42 +110824,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -115603,11 +111384,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -115618,42 +111394,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -116126,11 +111871,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116141,42 +111881,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -116331,11 +112040,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116346,42 +112050,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -116795,11 +112468,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -116810,42 +112478,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -117000,11 +112637,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -117015,42 +112647,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -122097,11 +117698,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -122112,42 +117708,11 @@ get names(): ((string | LanguageString))[] { context, \\"preview\\", [\\"https://www.w3.org/ns/activitystreams#preview\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -129585,11 +125150,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -129600,42 +125160,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -130069,11 +125598,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -130084,42 +125608,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -131637,11 +127130,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -131652,42 +127140,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"orderedItems\\", [\\"https://www.w3.org/ns/activitystreams#items\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -135590,11 +131047,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135605,42 +131057,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -135791,11 +131212,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -135806,42 +131222,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -136255,11 +131640,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -136270,42 +131650,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -136460,11 +131809,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -136475,42 +131819,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -136994,11 +132307,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137009,42 +132317,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -137478,11 +132755,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137493,42 +132765,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -137942,11 +133183,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -137957,42 +133193,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -138409,11 +133614,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138424,42 +133624,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -138874,11 +134043,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -138889,42 +134053,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -139337,11 +134470,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -139352,42 +134480,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -139800,11 +134897,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -139815,42 +134907,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -140260,11 +135321,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -140275,42 +135331,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -140724,11 +135749,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -140739,42 +135759,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -141330,11 +136319,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -141345,42 +136329,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -141853,11 +136806,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -141868,42 +136816,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -142058,11 +136975,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142073,42 +136985,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -142522,11 +137403,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142537,42 +137413,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -142727,11 +137572,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -142742,42 +137582,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -149873,11 +144682,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -149888,42 +144692,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -150074,11 +144847,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150089,42 +144857,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -150538,11 +145275,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150553,42 +145285,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -150743,11 +145444,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -150758,42 +145454,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -151277,11 +145942,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -151292,42 +145952,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -151761,11 +146390,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -151776,42 +146400,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -152225,11 +146818,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -152240,42 +146828,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -152692,11 +147249,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -152707,42 +147259,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -153157,11 +147678,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -153172,42 +147688,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -153620,11 +148105,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -153635,42 +148115,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -154083,11 +148532,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -154098,42 +148542,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -154543,11 +148956,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -154558,42 +148966,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -155007,11 +149384,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155022,42 +149394,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -155613,11 +149954,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -155628,42 +149964,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -156136,11 +150441,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156151,42 +150451,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -156341,11 +150610,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156356,42 +150620,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -156805,11 +151038,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -156820,42 +151048,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -157010,11 +151207,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -157025,42 +151217,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -162547,11 +156708,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -162562,42 +156718,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"describes\\", [\\"https://www.w3.org/ns/activitystreams#describes\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#describes_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -164350,11 +158475,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -164365,42 +158485,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"oneOf\\", [\\"https://www.w3.org/ns/activitystreams#oneOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#exclusiveOption_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -164817,11 +158906,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -164832,42 +158916,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"anyOf\\", [\\"https://www.w3.org/ns/activitystreams#anyOf\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#inclusiveOption_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -165310,11 +159363,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -165325,42 +159373,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quote\\", [\\"https://w3id.org/fep/044f#quote\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -165794,11 +159811,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -165809,42 +159821,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"quoteAuthorization\\", [\\"https://w3id.org/fep/044f#quoteAuthorization\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -168939,11 +162920,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -168954,42 +162930,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"subject\\", [\\"https://www.w3.org/ns/activitystreams#subject\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#subject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -169399,11 +163344,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169414,42 +163354,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -169601,11 +163510,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -169616,42 +163520,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"object\\", [\\"https://www.w3.org/ns/activitystreams#object\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -170064,11 +163937,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -170079,42 +163947,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -170268,11 +164105,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -170283,42 +164115,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, \\"relationship\\", [\\"https://www.w3.org/ns/activitystreams#relationship\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -174868,11 +168669,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -174883,42 +168679,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -175069,11 +168834,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175084,42 +168844,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"publicKey\\", [\\"https://w3id.org/security#publicKey\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -175533,11 +169262,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175548,42 +169272,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -175738,11 +169431,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -175753,42 +169441,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, \\"assertionMethod\\", [\\"https://w3id.org/security#assertionMethod\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -176272,11 +169929,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -176287,42 +169939,11 @@ get gateways(): (URL)[] { context, \\"inbox\\", [\\"http://www.w3.org/ns/ldp#inbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -176756,11 +170377,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -176771,42 +170387,11 @@ get gateways(): (URL)[] { context, \\"outbox\\", [\\"https://www.w3.org/ns/activitystreams#outbox\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -177220,11 +170805,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -177235,42 +170815,11 @@ get gateways(): (URL)[] { context, \\"following\\", [\\"https://www.w3.org/ns/activitystreams#following\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -177687,11 +171236,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -177702,42 +171246,11 @@ get gateways(): (URL)[] { context, \\"followers\\", [\\"https://www.w3.org/ns/activitystreams#followers\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -178152,11 +171665,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178167,42 +171675,11 @@ get gateways(): (URL)[] { context, \\"liked\\", [\\"https://www.w3.org/ns/activitystreams#liked\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -178615,11 +172092,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -178630,42 +172102,11 @@ get gateways(): (URL)[] { context, \\"featured\\", [\\"http://joinmastodon.org/ns#featured\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -179078,11 +172519,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -179093,42 +172529,11 @@ get gateways(): (URL)[] { context, \\"featuredTags\\", [\\"http://joinmastodon.org/ns#featuredTags\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -179538,11 +172943,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -179553,42 +172953,11 @@ get gateways(): (URL)[] { context, \\"featuredCollections\\", [\\"https://w3id.org/fep/7aa9#featuredCollections\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -180002,11 +173371,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180017,42 +173381,11 @@ get gateways(): (URL)[] { context, \\"streams\\", [\\"https://www.w3.org/ns/activitystreams#streams\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -180608,11 +173941,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -180623,42 +173951,11 @@ get attributionDomains(): (string)[] { context, \\"movedTo\\", [\\"https://www.w3.org/ns/activitystreams#movedTo\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -181131,11 +174428,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181146,42 +174438,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -181336,11 +174597,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181351,42 +174607,11 @@ get attributionDomains(): (string)[] { context, \\"alsoKnownAs\\", [\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -181800,11 +175025,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -181815,42 +175035,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -182005,11 +175194,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd[\\"@context\\"], @@ -182020,42 +175204,11 @@ get attributionDomains(): (string)[] { context, \\"service\\", [\\"https://www.w3.org/ns/did#service\\"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === \\"http:\\" || - this.id.protocol === \\"https:\\") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 0f7436f1e..2eff2578d 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -420,73 +420,46 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } -// The contexts embedded objects were decoded with, keyed by the objects. Their -// cached JSON-LD stays as it was received, as a proof can cover its context, so -// this is what decoding the objects nested in them has to start from: -const inheritedContexts = new WeakMap(); +// The contexts in effect for the cached JSON-LD of embedded objects, which +// stays as it was received, keyed by the objects. Telling which keys of such +// a document are which properties takes the contexts of its parents as well: +const cachedJsonLdContexts = new WeakMap(); function getCachedJsonLdContext(object: object, context: unknown): unknown { - return inheritedContexts.has(object) - ? inheritedContexts.get(object) + return cachedJsonLdContexts.has(object) + ? cachedJsonLdContexts.get(object) : context; } -// Puts the document an embedded object was received as back into its cache, -// after decoding it from the result of inheritJsonLdContext(): -async function keepCachedJsonLd( +// Objects that were given the document they were received as: +const receivedJsonLd = new WeakSet(); + +// Gives an embedded object, decoded along with the whole document, the document +// it was received as, which toJsonLd() has to return as is, as a proof can +// cover it. The object is not decoded from that document, since an embedded +// document alone cannot rebuild what its parents' contexts contributed to it, +// such as type-scoped and property-scoped contexts: +function keepReceivedJsonLd( object: unknown, document: object, - decoded: object, - contextLoader: DocumentLoader, -): Promise { - // A preprocessor can turn the value into a scalar: - if (decoded === document || object == null || typeof object !== "object") { - return; - } - const target = object as unknown as { _cachedJsonLd?: unknown }; - const cached = target._cachedJsonLd; - if (cached == null) return; - inheritedContexts.set(object, (decoded as { "@context"?: unknown })["@context"]); - // The decoder can normalize what it caches, e.g., portable object IRIs: - target._cachedJsonLd = - globalThis.JSON.stringify(cached) === globalThis.JSON.stringify(decoded) - ? structuredClone(document) - : await compactJsonLdCache( - await jsonld.expand(cached, { - documentLoader: contextLoader, - keepFreeFloatingNodes: true, - }), - document, - contextLoader, - ); -} - -// Embeds the context of a cached document in a document embedded in it, so -// that decoding the embedded document alone resolves its terms the same way -// as decoding the whole document did. The parent's context entries keep -// their order, as later entries can refer to terms earlier ones define. -// When the embedded document's own context already begins with all of them, -// it is used as is, since applying the same entries again yields the same -// terms: -function inheritJsonLdContext( parentContext: unknown, - document: object, -): object { - const own = (document as { "@context"?: unknown })["@context"]; - const ownEntries = globalThis.Array.isArray(own) ? own : [own]; - const parentEntries = globalThis.Array.isArray(parentContext) - ? parentContext - : [parentContext]; +): void { if ( - parentEntries.length <= ownEntries.length && - parentEntries.every((entry, i) => - globalThis.JSON.stringify(entry) === - globalThis.JSON.stringify(ownEntries[i]) - ) + object == null || typeof object !== "object" || + !(RAW_PROPERTY_PROTOCOL in object) || receivedJsonLd.has(object) ) { - return document; + return; } - return { ...document, "@context": [...parentEntries, ...ownEntries] }; + receivedJsonLd.add(object); + (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = + structuredClone(document); + const own = (document as { "@context"?: unknown })["@context"]; + cachedJsonLdContexts.set(object, [ + ...(globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]), + ...(globalThis.Array.isArray(own) ? own : [own]), + ]); } // The results of isCachedPropertyKey(), keyed by the document and then by the @@ -536,94 +509,6 @@ async function mapsOnlyKeyToProperty( } } -// Only the first entry of a context can declare that it does not propagate: -function isNonPropagatingContext(context: unknown): boolean { - const first = globalThis.Array.isArray(context) ? context[0] : context; - return first != null && typeof first === "object" && - (first as Record)["@propagate"] === false; -} - -// Objects whose contexts could not be rebuilt, so that neither they nor the -// objects nested in them can be decoded again from their cached JSON-LD: -const fixedCachedJsonLd = new WeakSet(); - -// Whether an embedded document under a key of the cached JSON-LD of an object -// can be decoded again. Prepending a context cannot rebuild what a context -// that does not propagate to embedded nodes, in the document or in the embedded -// document, or a type-scoped or property-scoped context took part in: -function canDecodeCachedJsonLd( - object: object, - context: unknown, - embedded: object, -): boolean { - return !fixedCachedJsonLd.has(object) && - !isNonPropagatingContext(context) && - !isNonPropagatingContext( - (embedded as { "@context"?: unknown })["@context"], - ) && - !hasScopedContext(context); -} - -// Gives an object decoded with the whole document the document it was received -// as, which a proof can cover, when it cannot be decoded from that document: -function fixCachedJsonLd(object: unknown, document: object): void { - if ( - object == null || typeof object !== "object" || - !(RAW_PROPERTY_PROTOCOL in object) - ) { - return; - } - (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = - structuredClone(document); - fixedCachedJsonLd.add(object); -} - -function hasScopedContext(context: unknown): boolean { - const entries = globalThis.Array.isArray(context) ? context : [context]; - return entries.some((entry) => - entry != null && typeof entry === "object" && - globalThis.Object.values(entry).some((term) => - term != null && typeof term === "object" && "@context" in term - ) - ); -} - -// Context loaders that load each URL once, keyed by the cached document whose -// embedded documents they decode and then by the wrapped loader. The documents -// can come from a remote peer, and decoding each of them with the parent's -// context must not multiply outbound requests by their number: -const sharedContextLoaders = new WeakMap< - object, - WeakMap ->(); - -function shareContextLoader( - document: object, - contextLoader: DocumentLoader, -): DocumentLoader { - let loaders = sharedContextLoaders.get(document); - if (loaders == null) { - loaders = new WeakMap(); - sharedContextLoaders.set(document, loaders); - } - let shared = loaders.get(contextLoader); - if (shared == null) { - const loads = new Map>(); - shared = (url, options) => { - let load = loads.get(url); - if (load == null) { - load = contextLoader(url, options); - loads.set(url, load); - // A failure is not remembered, so that a later call can try again: - load.catch(() => loads.delete(url)); - } - return load; - }; - loaders.set(contextLoader, shared); - } - return shared; -} - // Whether the embedded documents under a key of a compacted document are the // values decoded for a property. The document has to map the key, and no other // key, to the property, as a context can remap the key or map another term to @@ -6567,11 +6452,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -6582,42 +6462,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "attachment", ["https://www.w3.org/ns/activitystreams#attachment"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attachment_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7090,11 +6939,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -7105,42 +6949,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "attributedTo", ["https://www.w3.org/ns/activitystreams#attributedTo"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7294,11 +7107,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -7309,42 +7117,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "attributedTo", ["https://www.w3.org/ns/activitystreams#attributedTo"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#attribution_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7756,11 +7533,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -7771,42 +7543,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "audience", ["https://www.w3.org/ns/activitystreams#audience"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -7959,11 +7700,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -7974,42 +7710,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "audience", ["https://www.w3.org/ns/activitystreams#audience"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#audience_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -8474,11 +8179,6 @@ get contents(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -8489,42 +8189,11 @@ get contents(): ((string | LanguageString))[] { context, "context", ["https://www.w3.org/ns/activitystreams#context"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#context_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -8996,11 +8665,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -9011,42 +8675,11 @@ get names(): ((string | LanguageString))[] { context, "generator", ["https://www.w3.org/ns/activitystreams#generator"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#generator_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -9481,11 +9114,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -9496,42 +9124,11 @@ get names(): ((string | LanguageString))[] { context, "icon", ["https://www.w3.org/ns/activitystreams#icon"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -9685,11 +9282,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -9700,42 +9292,11 @@ get names(): ((string | LanguageString))[] { context, "icon", ["https://www.w3.org/ns/activitystreams#icon"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#icon_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -10170,11 +9731,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -10185,42 +9741,11 @@ get names(): ((string | LanguageString))[] { context, "image", ["https://www.w3.org/ns/activitystreams#image"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -10374,11 +9899,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -10389,42 +9909,11 @@ get names(): ((string | LanguageString))[] { context, "image", ["https://www.w3.org/ns/activitystreams#image"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#image_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -10851,11 +10340,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -10866,42 +10350,11 @@ get names(): ((string | LanguageString))[] { context, "inReplyTo", ["https://www.w3.org/ns/activitystreams#inReplyTo"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -11054,11 +10507,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -11069,42 +10517,11 @@ get names(): ((string | LanguageString))[] { context, "inReplyTo", ["https://www.w3.org/ns/activitystreams#inReplyTo"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#replyTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -11531,11 +10948,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -11546,42 +10958,11 @@ get names(): ((string | LanguageString))[] { context, "location", ["https://www.w3.org/ns/activitystreams#location"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -11734,11 +11115,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -11749,42 +11125,11 @@ get names(): ((string | LanguageString))[] { context, "location", ["https://www.w3.org/ns/activitystreams#location"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#location_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -12210,11 +11555,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -12225,42 +11565,11 @@ get names(): ((string | LanguageString))[] { context, "preview", ["https://www.w3.org/ns/activitystreams#preview"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -12412,11 +11721,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -12427,42 +11731,11 @@ get names(): ((string | LanguageString))[] { context, "preview", ["https://www.w3.org/ns/activitystreams#preview"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -12887,11 +12160,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -12902,42 +12170,11 @@ get names(): ((string | LanguageString))[] { context, "replies", ["https://www.w3.org/ns/activitystreams#replies"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replies_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -13354,11 +12591,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -13369,42 +12601,11 @@ get names(): ((string | LanguageString))[] { context, "shares", ["https://www.w3.org/ns/activitystreams#shares"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#shares_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -13821,11 +13022,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -13836,42 +13032,11 @@ get names(): ((string | LanguageString))[] { context, "likes", ["https://www.w3.org/ns/activitystreams#likes"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likes_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -14282,11 +13447,6 @@ get names(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -14297,42 +13457,11 @@ get names(): ((string | LanguageString))[] { context, "emojiReactions", ["http://fedibird.com/ns#emojiReactions"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#emojiReactions_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -14804,11 +13933,6 @@ get summaries(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -14819,42 +13943,11 @@ get summaries(): ((string | LanguageString))[] { context, "tag", ["https://www.w3.org/ns/activitystreams#tag"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#tag_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -15300,11 +14393,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -15315,42 +14403,11 @@ get urls(): ((URL | Link))[] { context, "to", ["https://www.w3.org/ns/activitystreams#to"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -15503,11 +14560,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -15518,42 +14570,11 @@ get urls(): ((URL | Link))[] { context, "to", ["https://www.w3.org/ns/activitystreams#to"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#to_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -15965,11 +14986,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -15980,42 +14996,11 @@ get urls(): ((URL | Link))[] { context, "bto", ["https://www.w3.org/ns/activitystreams#bto"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -16168,11 +15153,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -16183,42 +15163,11 @@ get urls(): ((URL | Link))[] { context, "bto", ["https://www.w3.org/ns/activitystreams#bto"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bto_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -16630,11 +15579,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -16645,42 +15589,11 @@ get urls(): ((URL | Link))[] { context, "cc", ["https://www.w3.org/ns/activitystreams#cc"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -16833,11 +15746,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -16848,42 +15756,11 @@ get urls(): ((URL | Link))[] { context, "cc", ["https://www.w3.org/ns/activitystreams#cc"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#cc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -17295,11 +16172,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -17310,42 +16182,11 @@ get urls(): ((URL | Link))[] { context, "bcc", ["https://www.w3.org/ns/activitystreams#bcc"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -17498,11 +16339,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -17513,42 +16349,11 @@ get urls(): ((URL | Link))[] { context, "bcc", ["https://www.w3.org/ns/activitystreams#bcc"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#bcc_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -18023,11 +16828,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -18038,42 +16838,11 @@ get urls(): ((URL | Link))[] { context, "proof", ["https://w3id.org/security#proof"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -18225,11 +16994,6 @@ get urls(): ((URL | Link))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -18240,42 +17004,11 @@ get urls(): ((URL | Link))[] { context, "proof", ["https://w3id.org/security#proof"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#proof_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -18726,11 +17459,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -18741,42 +17469,11 @@ get urls(): ((URL | Link))[] { context, "likeAuthorization", ["https://gotosocial.org/ns#likeAuthorization"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likeAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -19187,11 +17884,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -19202,42 +17894,11 @@ get urls(): ((URL | Link))[] { context, "replyAuthorization", ["https://gotosocial.org/ns#replyAuthorization"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#replyAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -19648,11 +18309,6 @@ get urls(): ((URL | Link))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -19663,42 +18319,11 @@ get urls(): ((URL | Link))[] { context, "announceAuthorization", ["https://gotosocial.org/ns#announceAuthorization"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#announceAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -26236,11 +24861,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -26251,42 +24871,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "quote", ["https://w3id.org/fep/044f#quote"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -26720,11 +25309,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -26735,42 +25319,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -29272,11 +27825,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -29287,42 +27835,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "actor", ["https://www.w3.org/ns/activitystreams#actor"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -29476,11 +27993,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -29491,42 +28003,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "actor", ["https://www.w3.org/ns/activitystreams#actor"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#actor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -29939,11 +28420,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -29954,42 +28430,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "object", ["https://www.w3.org/ns/activitystreams#object"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -30143,11 +28588,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -30158,42 +28598,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "object", ["https://www.w3.org/ns/activitystreams#object"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -30609,11 +29018,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -30624,42 +29028,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "target", ["https://www.w3.org/ns/activitystreams#target"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -30816,11 +29189,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -30831,42 +29199,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "target", ["https://www.w3.org/ns/activitystreams#target"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#target_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -31279,11 +29616,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -31294,42 +29626,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "result", ["https://www.w3.org/ns/activitystreams#result"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -31483,11 +29784,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -31498,42 +29794,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "result", ["https://www.w3.org/ns/activitystreams#result"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#result_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -31947,11 +30212,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -31962,42 +30222,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "origin", ["https://www.w3.org/ns/activitystreams#origin"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -32152,11 +30381,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -32167,42 +30391,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "origin", ["https://www.w3.org/ns/activitystreams#origin"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#origin_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -32614,11 +30807,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -32629,42 +30817,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "instrument", ["https://www.w3.org/ns/activitystreams#instrument"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#instrument_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -32817,11 +30974,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -32832,42 +30984,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "instrument", ["https://www.w3.org/ns/activitystreams#instrument"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#instrument_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -37187,11 +35308,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -37202,42 +35318,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -37647,11 +35732,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -37662,42 +35742,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -42300,11 +40349,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -42315,42 +40359,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -42760,11 +40773,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -42775,42 +40783,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -44716,11 +42693,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -44731,42 +42703,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -45176,11 +43117,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -45191,42 +43127,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -47131,11 +45036,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -47146,42 +45046,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -47591,11 +45460,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -47606,42 +45470,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -50184,11 +48017,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -50199,42 +48027,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "translator", ["https://schema.org/translator"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#translator_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -50391,11 +48188,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -50406,42 +48198,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "translator", ["https://schema.org/translator"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#translator_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -52279,11 +50040,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -52294,42 +50050,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactingObject", ["https://gotosocial.org/ns#interactingObject"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactingObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -52738,11 +50463,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -52753,42 +50473,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "interactionTarget", ["https://gotosocial.org/ns#interactionTarget"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#interactionTarget_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -55682,11 +53371,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -55697,42 +53381,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "current", ["https://www.w3.org/ns/activitystreams#current"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#current_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -56143,11 +53796,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -56158,42 +53806,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "first", ["https://www.w3.org/ns/activitystreams#first"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#first_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -56604,11 +54221,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -56619,42 +54231,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "last", ["https://www.w3.org/ns/activitystreams#last"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#last_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -57084,11 +54665,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -57099,42 +54675,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "items", ["https://www.w3.org/ns/activitystreams#items"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -57545,11 +55090,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -57560,42 +55100,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "likesOf", ["https://w3id.org/fep/5711#likesOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likesOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -58005,11 +55514,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -58020,42 +55524,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "sharesOf", ["https://w3id.org/fep/5711#sharesOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#sharesOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -58465,11 +55938,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -58480,42 +55948,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "repliesOf", ["https://w3id.org/fep/5711#repliesOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#repliesOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -58925,11 +56362,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -58940,42 +56372,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "inboxOf", ["https://w3id.org/fep/5711#inboxOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inboxOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -59385,11 +56786,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -59400,42 +56796,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "outboxOf", ["https://w3id.org/fep/5711#outboxOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outboxOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -59845,11 +57210,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -59860,42 +57220,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "followersOf", ["https://w3id.org/fep/5711#followersOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followersOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -60305,11 +57634,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -60320,42 +57644,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "followingOf", ["https://w3id.org/fep/5711#followingOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followingOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -60765,11 +58058,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -60780,42 +58068,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "likedOf", ["https://w3id.org/fep/5711#likedOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#likedOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -63401,11 +60658,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -63416,42 +60668,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "orderedItems", ["https://www.w3.org/ns/activitystreams#items"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -65626,11 +62847,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -65641,42 +62857,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "featuredObject", ["https://w3id.org/fep/7aa9#featuredObject"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredObject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -66087,11 +63272,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -66102,42 +63282,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "featureAuthorization", ["https://w3id.org/fep/7aa9#featureAuthorization"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featureAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -70736,11 +67885,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -70751,42 +67895,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "owner", ["https://w3id.org/security#owner"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#owner_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -72316,11 +69429,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -72331,42 +69439,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "controller", ["https://w3id.org/security#controller"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#controller_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -82680,11 +79757,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -82695,42 +79767,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -82881,11 +79922,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -82896,42 +79932,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -83345,11 +80350,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -83360,42 +80360,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -83550,11 +80519,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -83565,42 +80529,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -84084,11 +81017,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -84099,42 +81027,11 @@ get gateways(): (URL)[] { context, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -84568,11 +81465,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -84583,42 +81475,11 @@ get gateways(): (URL)[] { context, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -85032,11 +81893,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -85047,42 +81903,11 @@ get gateways(): (URL)[] { context, "following", ["https://www.w3.org/ns/activitystreams#following"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -85499,11 +82324,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -85514,42 +82334,11 @@ get gateways(): (URL)[] { context, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -85964,11 +82753,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -85979,42 +82763,11 @@ get gateways(): (URL)[] { context, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -86427,11 +83180,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -86442,42 +83190,11 @@ get gateways(): (URL)[] { context, "featured", ["http://joinmastodon.org/ns#featured"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -86890,11 +83607,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -86905,42 +83617,11 @@ get gateways(): (URL)[] { context, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -87350,11 +84031,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -87365,42 +84041,11 @@ get gateways(): (URL)[] { context, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -87814,11 +84459,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -87829,42 +84469,11 @@ get gateways(): (URL)[] { context, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -88420,11 +85029,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -88435,42 +85039,11 @@ get attributionDomains(): (string)[] { context, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -88943,11 +85516,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -88958,42 +85526,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -89148,11 +85685,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -89163,42 +85695,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -89612,11 +86113,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -89627,42 +86123,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -89817,11 +86282,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -89832,42 +86292,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -95058,11 +91487,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -95073,42 +91497,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "quote", ["https://w3id.org/fep/044f#quote"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -95542,11 +91935,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -95557,42 +91945,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -99798,11 +96155,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -99813,42 +96165,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "partOf", ["https://www.w3.org/ns/activitystreams#partOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#partOf_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -100257,11 +96578,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -100272,42 +96588,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "next", ["https://www.w3.org/ns/activitystreams#next"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#next_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -100717,11 +97002,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -100732,42 +97012,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "prev", ["https://www.w3.org/ns/activitystreams#prev"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#prev_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -109865,11 +106114,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -109880,42 +106124,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -110066,11 +106279,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -110081,42 +106289,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -110530,11 +106707,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -110545,42 +106717,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -110735,11 +106876,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -110750,42 +106886,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -111269,11 +107374,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -111284,42 +107384,11 @@ get gateways(): (URL)[] { context, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -111753,11 +107822,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -111768,42 +107832,11 @@ get gateways(): (URL)[] { context, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -112217,11 +108250,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -112232,42 +108260,11 @@ get gateways(): (URL)[] { context, "following", ["https://www.w3.org/ns/activitystreams#following"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -112684,11 +108681,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -112699,42 +108691,11 @@ get gateways(): (URL)[] { context, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -113149,11 +109110,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -113164,42 +109120,11 @@ get gateways(): (URL)[] { context, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -113612,11 +109537,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -113627,42 +109547,11 @@ get gateways(): (URL)[] { context, "featured", ["http://joinmastodon.org/ns#featured"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -114075,11 +109964,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -114090,42 +109974,11 @@ get gateways(): (URL)[] { context, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -114535,11 +110388,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -114550,42 +110398,11 @@ get gateways(): (URL)[] { context, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -114999,11 +110816,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -115014,42 +110826,11 @@ get gateways(): (URL)[] { context, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -115605,11 +111386,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -115620,42 +111396,11 @@ get attributionDomains(): (string)[] { context, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -116128,11 +111873,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -116143,42 +111883,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -116333,11 +112042,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -116348,42 +112052,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -116797,11 +112470,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -116812,42 +112480,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -117002,11 +112639,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -117017,42 +112649,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -122099,11 +117700,6 @@ get names(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -122114,42 +117710,11 @@ get names(): ((string | LanguageString))[] { context, "preview", ["https://www.w3.org/ns/activitystreams#preview"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#preview_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -129587,11 +125152,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -129602,42 +125162,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "quote", ["https://w3id.org/fep/044f#quote"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -130071,11 +125600,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -130086,42 +125610,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -131639,11 +127132,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -131654,42 +127142,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "orderedItems", ["https://www.w3.org/ns/activitystreams#items"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#item_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -135592,11 +131049,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -135607,42 +131059,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -135793,11 +131214,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -135808,42 +131224,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -136257,11 +131642,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -136272,42 +131652,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -136462,11 +131811,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -136477,42 +131821,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -136996,11 +132309,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -137011,42 +132319,11 @@ get gateways(): (URL)[] { context, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -137480,11 +132757,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -137495,42 +132767,11 @@ get gateways(): (URL)[] { context, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -137944,11 +133185,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -137959,42 +133195,11 @@ get gateways(): (URL)[] { context, "following", ["https://www.w3.org/ns/activitystreams#following"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -138411,11 +133616,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -138426,42 +133626,11 @@ get gateways(): (URL)[] { context, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -138876,11 +134045,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -138891,42 +134055,11 @@ get gateways(): (URL)[] { context, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -139339,11 +134472,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -139354,42 +134482,11 @@ get gateways(): (URL)[] { context, "featured", ["http://joinmastodon.org/ns#featured"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -139802,11 +134899,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -139817,42 +134909,11 @@ get gateways(): (URL)[] { context, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -140262,11 +135323,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -140277,42 +135333,11 @@ get gateways(): (URL)[] { context, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -140726,11 +135751,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -140741,42 +135761,11 @@ get gateways(): (URL)[] { context, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -141332,11 +136321,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -141347,42 +136331,11 @@ get attributionDomains(): (string)[] { context, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -141855,11 +136808,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -141870,42 +136818,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -142060,11 +136977,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -142075,42 +136987,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -142524,11 +137405,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -142539,42 +137415,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -142729,11 +137574,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -142744,42 +137584,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -149875,11 +144684,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -149890,42 +144694,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -150076,11 +144849,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -150091,42 +144859,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -150540,11 +145277,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -150555,42 +145287,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -150745,11 +145446,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -150760,42 +145456,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -151279,11 +145944,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -151294,42 +145954,11 @@ get gateways(): (URL)[] { context, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -151763,11 +146392,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -151778,42 +146402,11 @@ get gateways(): (URL)[] { context, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -152227,11 +146820,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -152242,42 +146830,11 @@ get gateways(): (URL)[] { context, "following", ["https://www.w3.org/ns/activitystreams#following"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -152694,11 +147251,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -152709,42 +147261,11 @@ get gateways(): (URL)[] { context, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -153159,11 +147680,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -153174,42 +147690,11 @@ get gateways(): (URL)[] { context, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -153622,11 +148107,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -153637,42 +148117,11 @@ get gateways(): (URL)[] { context, "featured", ["http://joinmastodon.org/ns#featured"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -154085,11 +148534,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -154100,42 +148544,11 @@ get gateways(): (URL)[] { context, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -154545,11 +148958,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -154560,42 +148968,11 @@ get gateways(): (URL)[] { context, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -155009,11 +149386,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -155024,42 +149396,11 @@ get gateways(): (URL)[] { context, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -155615,11 +149956,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -155630,42 +149966,11 @@ get attributionDomains(): (string)[] { context, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -156138,11 +150443,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -156153,42 +150453,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -156343,11 +150612,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -156358,42 +150622,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -156807,11 +151040,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -156822,42 +151050,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -157012,11 +151209,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -157027,42 +151219,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -162549,11 +156710,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -162564,42 +156720,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "describes", ["https://www.w3.org/ns/activitystreams#describes"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#describes_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -164352,11 +158477,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -164367,42 +158487,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "oneOf", ["https://www.w3.org/ns/activitystreams#oneOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#exclusiveOption_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -164819,11 +158908,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -164834,42 +158918,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "anyOf", ["https://www.w3.org/ns/activitystreams#anyOf"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#inclusiveOption_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -165312,11 +159365,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -165327,42 +159375,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "quote", ["https://w3id.org/fep/044f#quote"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quote_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -165796,11 +159813,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -165811,42 +159823,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "quoteAuthorization", ["https://w3id.org/fep/044f#quoteAuthorization"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#quoteAuthorization_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -168941,11 +162922,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -168956,42 +162932,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "subject", ["https://www.w3.org/ns/activitystreams#subject"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#subject_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -169401,11 +163346,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -169416,42 +163356,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "object", ["https://www.w3.org/ns/activitystreams#object"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -169603,11 +163512,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -169618,42 +163522,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "object", ["https://www.w3.org/ns/activitystreams#object"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#object_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -170066,11 +163939,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -170081,42 +163949,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "relationship", ["https://www.w3.org/ns/activitystreams#relationship"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -170270,11 +164107,6 @@ rawPropertyDescriptors.set(this.prototype, descriptors); const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -170285,42 +164117,11 @@ rawPropertyDescriptors.set(this.prototype, descriptors); context, "relationship", ["https://www.w3.org/ns/activitystreams#relationship"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#relationship_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -174870,11 +168671,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -174885,42 +168681,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -175071,11 +168836,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -175086,42 +168846,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "publicKey", ["https://w3id.org/security#publicKey"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#publicKey_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -175535,11 +169264,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -175550,42 +169274,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -175740,11 +169433,6 @@ get preferredUsernames(): ((string | LanguageString))[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -175755,42 +169443,11 @@ get preferredUsernames(): ((string | LanguageString))[] { context, "assertionMethod", ["https://w3id.org/security#assertionMethod"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#assertionMethod_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -176274,11 +169931,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -176289,42 +169941,11 @@ get gateways(): (URL)[] { context, "inbox", ["http://www.w3.org/ns/ldp#inbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#inbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -176758,11 +170379,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -176773,42 +170389,11 @@ get gateways(): (URL)[] { context, "outbox", ["https://www.w3.org/ns/activitystreams#outbox"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#outbox_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -177222,11 +170807,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -177237,42 +170817,11 @@ get gateways(): (URL)[] { context, "following", ["https://www.w3.org/ns/activitystreams#following"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#following_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -177689,11 +171238,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -177704,42 +171248,11 @@ get gateways(): (URL)[] { context, "followers", ["https://www.w3.org/ns/activitystreams#followers"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#followers_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -178154,11 +171667,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -178169,42 +171677,11 @@ get gateways(): (URL)[] { context, "liked", ["https://www.w3.org/ns/activitystreams#liked"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#liked_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -178617,11 +172094,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -178632,42 +172104,11 @@ get gateways(): (URL)[] { context, "featured", ["http://joinmastodon.org/ns#featured"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featured_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -179080,11 +172521,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -179095,42 +172531,11 @@ get gateways(): (URL)[] { context, "featuredTags", ["http://joinmastodon.org/ns#featuredTags"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredTags_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -179540,11 +172945,6 @@ get gateways(): (URL)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -179555,42 +172955,11 @@ get gateways(): (URL)[] { context, "featuredCollections", ["https://w3id.org/fep/7aa9#featuredCollections"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#featuredCollections_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -180004,11 +173373,6 @@ get gateways(): (URL)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -180019,42 +173383,11 @@ get gateways(): (URL)[] { context, "streams", ["https://www.w3.org/ns/activitystreams#streams"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#stream_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -180610,11 +173943,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -180625,42 +173953,11 @@ get attributionDomains(): (string)[] { context, "movedTo", ["https://www.w3.org/ns/activitystreams#movedTo"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#successor_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -181133,11 +174430,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -181148,42 +174440,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -181338,11 +174599,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -181353,42 +174609,11 @@ get attributionDomains(): (string)[] { context, "alsoKnownAs", ["https://www.w3.org/ns/activitystreams#alsoKnownAs"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#alias_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; @@ -181802,11 +175027,6 @@ get attributionDomains(): (string)[] { const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -181817,42 +175037,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -182007,11 +175196,6 @@ get attributionDomains(): (string)[] { const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -182022,42 +175206,11 @@ get attributionDomains(): (string)[] { context, "service", ["https://www.w3.org/ns/did#service"], - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#service_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: (options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined), - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index b90f17047..ed858edef 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -31,13 +31,6 @@ async function* generateProperty( const override = emitOverride(type.uri, types, property); const trustOwner = type.trustEmbeddedObjects === false ? "null" : "this.id"; const doc = `\n/** ${property.description.replaceAll("\n", "\n * ")}\n */\n`; - const cachedPropertyBaseUrl = `(options as { baseUrl?: URL }).baseUrl ?? - this._baseUrl ?? - (this.id != null && - (this.id.protocol === "http:" || - this.id.protocol === "https:") - ? this.id - : undefined)`; if (areAllScalarTypes(property.range, types)) { if (hasSingularAccessor(property)) { yield doc; @@ -491,11 +484,6 @@ async function* generateProperty( const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -511,36 +499,11 @@ async function* generateProperty( ...(property.redundantProperties ?? []).map((p) => p.uri), ]) }, - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - doc, - ) - ) { - const inherited = inheritJsonLdContext(context, doc); - v = await this.#${property.singularName}_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: ${cachedPropertyBaseUrl}, - }, - ); - await keepCachedJsonLd( - v, - doc, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, doc); - } + keepReceivedJsonLd(v, doc, context); } } catch (error) { if (!options.suppressError) throw error; @@ -717,11 +680,6 @@ async function* generateProperty( const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { try { - const cachedContextLoader = shareContextLoader( - this._cachedJsonLd, - options.contextLoader ?? this._contextLoader ?? - getDocumentLoader(), - ); const context = getCachedJsonLdContext( this, this._cachedJsonLd["@context"], @@ -737,36 +695,11 @@ async function* generateProperty( ...(property.redundantProperties ?? []).map((p) => p.uri), ]) }, - cachedContextLoader, + options.contextLoader ?? this._contextLoader ?? + getDocumentLoader(), ) ) { - if ( - canDecodeCachedJsonLd( - this, - context, - obj, - ) - ) { - const inherited = inheritJsonLdContext(context, obj); - v = await this.#${property.singularName}_fromJsonLd( - inherited, - { - ...options, - contextLoader: cachedContextLoader, - // Keep the parent default for embedded objects. - verifyPortableObject: this._verifyPortableObject, - baseUrl: ${cachedPropertyBaseUrl}, - }, - ); - await keepCachedJsonLd( - v, - obj, - inherited, - cachedContextLoader, - ); - } else { - fixCachedJsonLd(v, obj); - } + keepReceivedJsonLd(v, obj, context); } } catch (error) { if (!options.suppressError) throw error; diff --git a/packages/vocab-tools/src/raw-property.ts b/packages/vocab-tools/src/raw-property.ts index d67657199..c681f1b30 100644 --- a/packages/vocab-tools/src/raw-property.ts +++ b/packages/vocab-tools/src/raw-property.ts @@ -97,73 +97,46 @@ function copyRawProperties(source: object, destination: object): void { else retainedRawProperties.set(destination, retained); } -// The contexts embedded objects were decoded with, keyed by the objects. Their -// cached JSON-LD stays as it was received, as a proof can cover its context, so -// this is what decoding the objects nested in them has to start from: -const inheritedContexts = new WeakMap(); +// The contexts in effect for the cached JSON-LD of embedded objects, which +// stays as it was received, keyed by the objects. Telling which keys of such +// a document are which properties takes the contexts of its parents as well: +const cachedJsonLdContexts = new WeakMap(); function getCachedJsonLdContext(object: object, context: unknown): unknown { - return inheritedContexts.has(object) - ? inheritedContexts.get(object) + return cachedJsonLdContexts.has(object) + ? cachedJsonLdContexts.get(object) : context; } -// Puts the document an embedded object was received as back into its cache, -// after decoding it from the result of inheritJsonLdContext(): -async function keepCachedJsonLd( +// Objects that were given the document they were received as: +const receivedJsonLd = new WeakSet(); + +// Gives an embedded object, decoded along with the whole document, the document +// it was received as, which toJsonLd() has to return as is, as a proof can +// cover it. The object is not decoded from that document, since an embedded +// document alone cannot rebuild what its parents' contexts contributed to it, +// such as type-scoped and property-scoped contexts: +function keepReceivedJsonLd( object: unknown, document: object, - decoded: object, - contextLoader: DocumentLoader, -): Promise { - // A preprocessor can turn the value into a scalar: - if (decoded === document || object == null || typeof object !== "object") { - return; - } - const target = object as unknown as { _cachedJsonLd?: unknown }; - const cached = target._cachedJsonLd; - if (cached == null) return; - inheritedContexts.set(object, (decoded as { "@context"?: unknown })["@context"]); - // The decoder can normalize what it caches, e.g., portable object IRIs: - target._cachedJsonLd = - globalThis.JSON.stringify(cached) === globalThis.JSON.stringify(decoded) - ? structuredClone(document) - : await compactJsonLdCache( - await jsonld.expand(cached, { - documentLoader: contextLoader, - keepFreeFloatingNodes: true, - }), - document, - contextLoader, - ); -} - -// Embeds the context of a cached document in a document embedded in it, so -// that decoding the embedded document alone resolves its terms the same way -// as decoding the whole document did. The parent's context entries keep -// their order, as later entries can refer to terms earlier ones define. -// When the embedded document's own context already begins with all of them, -// it is used as is, since applying the same entries again yields the same -// terms: -function inheritJsonLdContext( parentContext: unknown, - document: object, -): object { - const own = (document as { "@context"?: unknown })["@context"]; - const ownEntries = globalThis.Array.isArray(own) ? own : [own]; - const parentEntries = globalThis.Array.isArray(parentContext) - ? parentContext - : [parentContext]; +): void { if ( - parentEntries.length <= ownEntries.length && - parentEntries.every((entry, i) => - globalThis.JSON.stringify(entry) === - globalThis.JSON.stringify(ownEntries[i]) - ) + object == null || typeof object !== "object" || + !(RAW_PROPERTY_PROTOCOL in object) || receivedJsonLd.has(object) ) { - return document; + return; } - return { ...document, "@context": [...parentEntries, ...ownEntries] }; + receivedJsonLd.add(object); + (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = + structuredClone(document); + const own = (document as { "@context"?: unknown })["@context"]; + cachedJsonLdContexts.set(object, [ + ...(globalThis.Array.isArray(parentContext) + ? parentContext + : [parentContext]), + ...(globalThis.Array.isArray(own) ? own : [own]), + ]); } // The results of isCachedPropertyKey(), keyed by the document and then by the @@ -213,94 +186,6 @@ async function mapsOnlyKeyToProperty( } } -// Only the first entry of a context can declare that it does not propagate: -function isNonPropagatingContext(context: unknown): boolean { - const first = globalThis.Array.isArray(context) ? context[0] : context; - return first != null && typeof first === "object" && - (first as Record)["@propagate"] === false; -} - -// Objects whose contexts could not be rebuilt, so that neither they nor the -// objects nested in them can be decoded again from their cached JSON-LD: -const fixedCachedJsonLd = new WeakSet(); - -// Whether an embedded document under a key of the cached JSON-LD of an object -// can be decoded again. Prepending a context cannot rebuild what a context -// that does not propagate to embedded nodes, in the document or in the embedded -// document, or a type-scoped or property-scoped context took part in: -function canDecodeCachedJsonLd( - object: object, - context: unknown, - embedded: object, -): boolean { - return !fixedCachedJsonLd.has(object) && - !isNonPropagatingContext(context) && - !isNonPropagatingContext( - (embedded as { "@context"?: unknown })["@context"], - ) && - !hasScopedContext(context); -} - -// Gives an object decoded with the whole document the document it was received -// as, which a proof can cover, when it cannot be decoded from that document: -function fixCachedJsonLd(object: unknown, document: object): void { - if ( - object == null || typeof object !== "object" || - !(RAW_PROPERTY_PROTOCOL in object) - ) { - return; - } - (object as unknown as { _cachedJsonLd?: unknown })._cachedJsonLd = - structuredClone(document); - fixedCachedJsonLd.add(object); -} - -function hasScopedContext(context: unknown): boolean { - const entries = globalThis.Array.isArray(context) ? context : [context]; - return entries.some((entry) => - entry != null && typeof entry === "object" && - globalThis.Object.values(entry).some((term) => - term != null && typeof term === "object" && "@context" in term - ) - ); -} - -// Context loaders that load each URL once, keyed by the cached document whose -// embedded documents they decode and then by the wrapped loader. The documents -// can come from a remote peer, and decoding each of them with the parent's -// context must not multiply outbound requests by their number: -const sharedContextLoaders = new WeakMap< - object, - WeakMap ->(); - -function shareContextLoader( - document: object, - contextLoader: DocumentLoader, -): DocumentLoader { - let loaders = sharedContextLoaders.get(document); - if (loaders == null) { - loaders = new WeakMap(); - sharedContextLoaders.set(document, loaders); - } - let shared = loaders.get(contextLoader); - if (shared == null) { - const loads = new Map>(); - shared = (url, options) => { - let load = loads.get(url); - if (load == null) { - load = contextLoader(url, options); - loads.set(url, load); - // A failure is not remembered, so that a later call can try again: - load.catch(() => loads.delete(url)); - } - return load; - }; - loaders.set(contextLoader, shared); - } - return shared; -} - // Whether the embedded documents under a key of a compacted document are the // values decoded for a property. The document has to map the key, and no other // key, to the property, as a context can remap the key or map another term to diff --git a/packages/vocab/src/raw-property.test.ts b/packages/vocab/src/raw-property.test.ts index bd7c20055..1c06687e3 100644 --- a/packages/vocab/src/raw-property.test.ts +++ b/packages/vocab/src/raw-property.test.ts @@ -124,7 +124,7 @@ test("getRawPropertyValues() reads embedded objects", async () => { test("getRawPropertyValues() reads embedded objects with their own contexts", async () => { // The prefix comes from the parent, while the embedded note has its own - // context, so the accessors reparse it from the cached JSON-LD: + // context, so the accessors find it in the cached JSON-LD: const create = await Create.fromJsonLd({ "@context": [AS, { quant: QUANT }], id: "https://example.com/activities/1", @@ -148,7 +148,7 @@ test("getRawPropertyValues() reads embedded objects with their own contexts", as ]); }); -test("getRawPropertyValues() reads objects nested in reparsed embedded objects", async () => { +test("getRawPropertyValues() reads objects nested in cached embedded objects", async () => { const create = await Create.fromJsonLd({ "@context": [AS, { quant: QUANT }], id: "https://example.com/activities/1", diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 618ba94ae..f1b263da6 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -2237,90 +2237,15 @@ function embeddedPropertyDocument(property: "attachment" | "object") { "@context": context, type: property === "attachment" ? "Note" : "Create", [property]: [ - { - "@context": [context, { "@vocab": "https://example.com/" }], - type: "CustomImage", - name: "Malformed when reparsed", - }, { "@context": context, type: "Image", name: "Cached image" }, + { "@context": context, type: "Image", name: "Other cached image" }, { type: "Image", name: "Decoded image" }, ], }; } -// Decodes a document whose first embedded object is valid, and then gives the -// decoded object a cache whose first embedded object cannot be decoded: -async function fromJsonLdWithMalformedCache( - fromJsonLd: (json: unknown) => Promise, - property: "attachment" | "object", -): Promise { - const jsonLd = embeddedPropertyDocument(property); - const [, ...rest] = jsonLd[property] as unknown[]; - const decoded = await fromJsonLd({ - ...jsonLd, - [property]: [{ type: "Image", name: "Malformed when reparsed" }, ...rest], - }); - (decoded as unknown as { _cachedJsonLd: unknown })._cachedJsonLd = jsonLd; - return decoded; -} - -for (const suppressError of [undefined, false, true]) { - test( - `Note.getAttachments() cached parse failure (suppressError: ${suppressError})`, - async () => { - const jsonLd = embeddedPropertyDocument("attachment"); - const note = await fromJsonLdWithMalformedCache( - (json) => Note.fromJsonLd(json), - "attachment", - ); - if (suppressError) { - for (let i = 0; i < 2; i++) { - const attachments: (Object | Link | PropertyValue)[] = await Array - .fromAsync( - note.getAttachments({ suppressError }), - ); - deepStrictEqual( - attachments.map((attachment) => attachment.name), - ["Cached image", "Decoded image"], - ); - } - // Suppression must not remove or replace the cached malformed value. - await rejects(() => Array.fromAsync(note.getAttachments()), TypeError); - } else { - await rejects( - () => Array.fromAsync(note.getAttachments({ suppressError })), - TypeError, - ); - } - deepStrictEqual(await note.toJsonLd(), jsonLd); - }, - ); - - test( - `Activity.getObject() cached parse failure (suppressError: ${suppressError})`, - async () => { - const jsonLd = embeddedPropertyDocument("object"); - const activity = await fromJsonLdWithMalformedCache( - (json) => Activity.fromJsonLd(json), - "object", - ); - if (suppressError) { - deepStrictEqual(await activity.getObject({ suppressError }), null); - deepStrictEqual(await activity.getObject({ suppressError }), null); - await rejects(() => activity.getObject(), TypeError); - } else { - await rejects(() => activity.getObject({ suppressError }), TypeError); - } - deepStrictEqual(await activity.toJsonLd(), jsonLd); - }, - ); -} - test("Note.getAttachments() suppresses cached context loader failures", async () => { - const note = await fromJsonLdWithMalformedCache( - (json) => Note.fromJsonLd(json), - "attachment", - ); + const note = await Note.fromJsonLd(embeddedPropertyDocument("attachment")); const contextLoader = () => Promise.reject(new Error("Context loader failed")); await rejects( @@ -2337,9 +2262,8 @@ test("Note.getAttachments() suppresses cached context loader failures", async () }); test("Activity.getObject() suppresses cached context loader failures", async () => { - const activity = await fromJsonLdWithMalformedCache( - (json) => Activity.fromJsonLd(json), - "object", + const activity = await Activity.fromJsonLd( + embeddedPropertyDocument("object"), ); const contextLoader = () => Promise.reject(new Error("Context loader failed"));